def translate_attributes(op, server_dict, operation_kwargs):
 auto_disk_config_raw = server_dict.pop(API_DISK_CONFIG, None)
 if (auto_disk_config_raw is not None):
  auto_disk_config = disk_config_from_api(auto_disk_config_raw)
  operation_kwargs['auto_disk_config'] = auto_disk_config
 if (API_ACCESS_V4 in server_dict):
  operation_kwargs['access_ip_v4'] = server_dict.pop(API_ACCESS_V4)
 if (API_ACCESS_V6 in server_dict):
  operation_kwargs['access_ip_v6'] = server_dict.pop(API_ACCESS_V6)
 if (('preserve_ephemeral' in server_dict) and (op == REBUILD)):
  preserve = strutils.bool_from_string(server_dict.pop('preserve_ephemeral'), strict=True)
  operation_kwargs['preserve_ephemeral'] = preserve
 if ('personality' in server_dict):
  if (op == REBUILD):
   operation_kwargs['files_to_inject'] = get_injected_files(server_dict.pop('personality'))
 if (op == CREATE):
  operation_kwargs['injected_files'] = get_injected_files(server_dict.pop('personality', []))

def translate_attributes ( op , server_dict , operation_kwargs ) : auto_disk_config_raw = server_dict . pop ( API_DISK_CONFIG , None ) if ( auto_disk_config_raw is not None ) : auto_disk_config = disk_config_from_api ( auto_disk_config_raw ) operation_kwargs [ 'auto_disk_config' ] = auto_disk_config if ( API_ACCESS_V4 in server_dict ) : operation_kwargs [ 'access_ip_v4' ] = server_dict . pop ( API_ACCESS_V4 ) if ( API_ACCESS_V6 in server_dict ) : operation_kwargs [ 'access_ip_v6' ] = server_dict . pop ( API_ACCESS_V6 ) if ( ( 'preserve_ephemeral' in server_dict ) and ( op == REBUILD ) ) : preserve = strutils . bool_from_string ( server_dict . pop ( 'preserve_ephemeral' ) , strict = True ) operation_kwargs [ 'preserve_ephemeral' ] = preserve if ( 'personality' in server_dict ) : if ( op == REBUILD ) : operation_kwargs [ 'files_to_inject' ] = get_injected_files ( server_dict . pop ( 'personality' ) ) if ( op == CREATE ) : operation_kwargs [ 'injected_files' ] = get_injected_files ( server_dict . pop ( 'personality' , [ ] ) )
translate rest attributes on create to server object kwargs .