def preflight_check(self): preflight_result = [] # require that username exists before resetting secret if not unique_user_exists(self.username): self.preflight_check_result.status = 'FAIL' preflight_result.append(simple_error_format( skybase.exceptions.SkyBaseUserIdNotFoundError( 'username {0} not found'.format(self.username)))) if not self.secret: self.secret = generate_random_key() self.preflight_check_result.set_output(preflight_result) return self.preflight_check_result
def preflight_check(self): # initialize results container preflight_result = [] # validate that username doesn't exist if unique_user_exists(self.username): self.preflight_check_result.status = 'FAIL' preflight_result.append(simple_error_format( SkyBaseUserAuthorizationError( 'username {0} exists'.format(self.username)))) if not self.secret: # if secret not defined, generate a secret key self.secret = generate_random_key() self.preflight_check_result.set_output(preflight_result) return self.preflight_check_result
def preflight_check(self): # initialize results container preflight_result = [] # validate that username doesn't exist if unique_user_exists(self.username): self.preflight_check_result.status = 'FAIL' preflight_result.append( simple_error_format( SkyBaseUserAuthorizationError('username {0} exists'.format( self.username)))) if not self.secret: # if secret not defined, generate a secret key self.secret = generate_random_key() self.preflight_check_result.set_output(preflight_result) return self.preflight_check_result