correct me if i am wrong  but i think here what you want is if x encryption type in auth fn a  elif auth fn b  else auth fn c authenticateopen  or  what about doing  authentication methods  wpa self  authenticatewpa wp a x wep x auth process authentication methods get self ap encrypt type  self  authenticteopen 