def insert_system_roles():
 system_roles = SystemRole.get_valid_values()
 for role_name in system_roles:
  description = role_name
  role_db = RoleDB(name=role_name, description=description, system=True)
  try:
   Role.insert(role_db, log_not_unique_error_as_debug=True)
  except (StackStormDBObjectConflictError, NotUniqueError):
   pass

def insert_system_roles ( ) : system_roles = SystemRole . get_valid_values ( ) for role_name in system_roles : description = role_name role_db = RoleDB ( name = role_name , description = description , system = True ) try : Role . insert ( role_db , log_not_unique_error_as_debug = True ) except ( StackStormDBObjectConflictError , NotUniqueError ) : pass
migration which inserts the default system roles .