This logic needs to be updated a little bit - pargs.profile will never be False, so the else statement will never fire.  You need to modify a little bit to determine what has been specified as opposed to the default values.