@api_wrapper
def update_client(module, export):
 changed = False
 client = module.params['client']
 access_mode = module.params['access_mode']
 no_root_squash = module.params['no_root_squash']
 client_list = export.get_permissions()
 client_not_in_list = True
 for (index, item) in enumerate(client_list):
  if (item.client == client):
   client_not_in_list = False
   if (item.access != access_mode):
    item.access = access_mode
    changed = True
   if (item.no_root_squash is not no_root_squash):
    item.no_root_squash = no_root_squash
    changed = True
 if client_not_in_list:
  changed = True
  client_list.append(Munch(client=client, access=access_mode, no_root_squash=no_root_squash))
 if changed:
  for (index, item) in enumerate(client_list):
   client_list[index] = unmunchify(item)
  if (not module.check_mode):
   export.update_permissions(client_list)
 module.exit_json(changed=changed)

@ api_wrapper def update_client ( module , export ) : changed = False client = module . params [ 'client' ] access_mode = module . params [ 'access_mode' ] no_root_squash = module . params [ 'no_root_squash' ] client_list = export . get_permissions ( ) client_not_in_list = True for ( index , item ) in enumerate ( client_list ) : if ( item . client == client ) : client_not_in_list = False if ( item . access != access_mode ) : item . access = access_mode changed = True if ( item . no_root_squash is not no_root_squash ) : item . no_root_squash = no_root_squash changed = True if client_not_in_list : changed = True client_list . append ( Munch ( client = client , access = access_mode , no_root_squash = no_root_squash ) ) if changed : for ( index , item ) in enumerate ( client_list ) : client_list [ index ] = unmunchify ( item ) if ( not module . check_mode ) : export . update_permissions ( client_list ) module . exit_json ( changed = changed )
update export client list .