def main(conninfo, credentials, args): response = nfs.nfs_get_export(conninfo, credentials, args.id, args.export_path) export_info = {} export_info, export_info['if_match'] = response export_info['id_'] = export_info['id'] export_info['allow_fs_path_create'] = args.create_fs_path if args.present_64_bit_fields_as_32_bit is not None: export_info['present_64_bit_fields_as_32_bit'] = \ args.present_64_bit_fields_as_32_bit del export_info['id'] if args.new_export_path is not None: export_info['export_path'] = args.new_export_path if args.fs_path is not None: export_info['fs_path'] = args.fs_path if args.description is not None: export_info['description'] = args.description if args.restrictions: export_info['restrictions'] = parse_nfs_export_restrictions_file( args.restrictions) elif args.no_restrictions: export_info['restrictions'] = \ [NFSExportRestriction.create_default()] else: export_info['restrictions'] = \ [NFSExportRestriction(r) for r in export_info['restrictions']] print nfs.nfs_modify_export(conninfo, credentials, **export_info)
def main(conninfo, credentials, args): if args.restrictions: restrictions = parse_nfs_export_restrictions_file( args.restrictions) else: restrictions = [NFSExportRestriction.create_default()] print nfs.nfs_add_export(conninfo, credentials, args.export_path, args.fs_path, args.description, restrictions, allow_fs_path_create=args.create_fs_path, present_64_bit_fields_as_32_bit=args. present_64_bit_fields_as_32_bit)