From b670d8bcecad4a55dfa386860b4d62f2aed513d0 Mon Sep 17 00:00:00 2001 From: ichisuke55 Date: Mon, 12 Dec 2022 17:23:00 +0900 Subject: [PATCH] chore: fix the misspelled words --- python/avi/migrationtools/avi_migration_utils.py | 4 ++-- python/avi/migrationtools/custom_config.py | 2 +- python/avi/migrationtools/nsxt_converter/README.md | 2 +- .../nsxt_converter/monitor_converter.py | 4 ++-- .../migrationtools/nsxt_converter/nsxt_cleanup.py | 6 +++--- .../nsxt_converter/nsxt_config_converter.py | 4 ++-- .../nsxt_converter/nsxt_converter.py | 6 +++--- .../migrationtools/nsxt_converter/nsxt_rollback.py | 6 +++--- .../nsxt_converter/nsxt_traffic_cutover.py | 6 +++--- .../avi/migrationtools/nsxt_converter/nsxt_util.py | 14 +++++++------- .../nsxt_converter/policy_converter.py | 4 ++-- .../nsxt_converter/pools_converter.py | 2 +- .../nsxt_converter/test/test_migrationtool.py | 2 +- .../nsxt_converter/test/test_nsxt_functional.py | 2 +- 14 files changed, 32 insertions(+), 32 deletions(-) diff --git a/python/avi/migrationtools/avi_migration_utils.py b/python/avi/migrationtools/avi_migration_utils.py index f7b96f5c3a..4fc7fe9bad 100644 --- a/python/avi/migrationtools/avi_migration_utils.py +++ b/python/avi/migrationtools/avi_migration_utils.py @@ -531,7 +531,7 @@ def get_obj_type_from_ref(self, url): def get_object_ref(self, object_name, object_type, tenant='admin', cloud_name='Default-Cloud', prefix=None, cloud_tenant ="admin"): """ - This function defines that to genarte object ref in the format of + This function defines that to generate object ref in the format of /api/object_type/?tenant=tenant_name&name=object_name&cloud=cloud_name :param object_name: Name of object :param object_type: Type of object @@ -1230,7 +1230,7 @@ def vs_per_skipped_setting_for_references(self, avi_config): vs_ref, profile_csv_list, pool_skipped_settings) if pool_skipped_settings['pools']: skipped_setting['Pool'] = pool_skipped_settings - # Get the skipepd list for http policy. + # Get the skipped list for http policy. if 'http_policies' in virtual_service: policy_csv_list = self.get_csv_object_list( csv_writer_dict_list, ['policy', 'profile']) diff --git a/python/avi/migrationtools/custom_config.py b/python/avi/migrationtools/custom_config.py index d2832cd597..d4cc8fefd5 100644 --- a/python/avi/migrationtools/custom_config.py +++ b/python/avi/migrationtools/custom_config.py @@ -16,7 +16,7 @@ def ref_clean_up(obj): """ Loops through list of policies and datascripts and removes un-needed fields - :param obj: Object for which referances to clean up + :param obj: Object for which references to clean up :return Updated object """ clean_up = ['uuid', 'url', '_last_modified', 'is_internal_policy'] diff --git a/python/avi/migrationtools/nsxt_converter/README.md b/python/avi/migrationtools/nsxt_converter/README.md index 3e480dd3e4..d12842fdfe 100644 --- a/python/avi/migrationtools/nsxt_converter/README.md +++ b/python/avi/migrationtools/nsxt_converter/README.md @@ -146,7 +146,7 @@ located in this repository will help you understand the basics about how Avi wor -i DEFAULT_PARAMS_FILE, --default_params_file DEFAULT_PARAMS_FILE absolute path for nsx-t default params file -n NSXT_IP, --nsxt_ip NSXT_IP - Ip of NSXT + Ip of NSX-T -u NSXT_USER, --nsxt_user NSXT_USER NSX-T User name -p NSXT_PASSWORD, --nsxt_password NSXT_PASSWORD diff --git a/python/avi/migrationtools/nsxt_converter/monitor_converter.py b/python/avi/migrationtools/nsxt_converter/monitor_converter.py index 0f446b4006..e003e67159 100755 --- a/python/avi/migrationtools/nsxt_converter/monitor_converter.py +++ b/python/avi/migrationtools/nsxt_converter/monitor_converter.py @@ -130,7 +130,7 @@ def convert(self, alb_config, nsx_lb_config, prefix, tenant, custom_mapping): if '/' in monitor_type: monitor_type = monitor_type.split('/')[-1] m_tenant, m_name = conv_utils.get_tenant_ref(name) - # Check if custom cofig present for this HM + # Check if custom config present for this HM r_hm = [obj for obj in custom_config if obj['monitor_name'] == m_name] if r_hm: @@ -420,7 +420,7 @@ def update_ca_cert_obj(self, name, avi_config, converted_objs, tenant, prefix, c if not ca_cert: key, ca_cert = conv_utils.create_self_signed_cert() name = '%s-%s' % (name, final.PLACE_HOLDER_STR) - LOG.warning('Create self cerificate and key for : %s' % name) + LOG.warning('Create self certificate and key for : %s' % name) ssl_kc_obj = None diff --git a/python/avi/migrationtools/nsxt_converter/nsxt_cleanup.py b/python/avi/migrationtools/nsxt_converter/nsxt_cleanup.py index ae4a92b0cb..236dd6e103 100755 --- a/python/avi/migrationtools/nsxt_converter/nsxt_cleanup.py +++ b/python/avi/migrationtools/nsxt_converter/nsxt_cleanup.py @@ -30,7 +30,7 @@ def __init__(self, args): ''' self.nsxt_ip = args.nsxt_ip self.nsxt_user = args.nsxt_user - self.nsxt_passord = args.nsxt_password + self.nsxt_password = args.nsxt_password self.nsxt_port = args.nsxt_port self.cleanup_vs_names = args.vs_filter self.output_file_path = args.output_file_path if args.output_file_path \ @@ -66,7 +66,7 @@ def initiate_cleanup(self): self.init_logger_path() if self.cleanup_vs_names: - nsx_c = NSXCleanup(self.nsxt_user, self.nsxt_passord, self.nsxt_ip, self.nsxt_port) + nsx_c = NSXCleanup(self.nsxt_user, self.nsxt_password, self.nsxt_ip, self.nsxt_port) nsx_c.nsx_cleanup(self.cleanup_vs_names) if nsx_c.vs_not_found: @@ -97,7 +97,7 @@ def initiate_cleanup(self): help='comma separated vs names that we want to cleanup from nsx-t side', required=True) parser.add_argument('-n', '--nsxt_ip', - help='Ip of NSXT', required=True) + help='Ip of NSX-T', required=True) parser.add_argument('-u', '--nsxt_user', help='NSX-T User name') parser.add_argument('-p', '--nsxt_password', diff --git a/python/avi/migrationtools/nsxt_converter/nsxt_config_converter.py b/python/avi/migrationtools/nsxt_converter/nsxt_config_converter.py index c555b9349a..d580abdc3b 100755 --- a/python/avi/migrationtools/nsxt_converter/nsxt_config_converter.py +++ b/python/avi/migrationtools/nsxt_converter/nsxt_config_converter.py @@ -48,7 +48,7 @@ def convert(nsx_lb_config, input_path, output_path, tenant, prefix, migrate_to, object_merge_check, controller_version, ssh_root_password, nsxt_util, migration_input_config=None, vs_state=False, vs_level_status=False, vrf=None, segroup=None, not_in_use=True, custom_mapping=None, traffic_enabled=False, cloud_tenant="admin", - nsxt_ip=None, nsxt_passord=None): + nsxt_ip=None, nsxt_password=None): # load the yaml file attribute in nsxt_attributes. nsxt_attributes = conv_const.init() @@ -84,7 +84,7 @@ def convert(nsx_lb_config, input_path, output_path, tenant, prefix, persist_conv.convert(avi_config_dict, nsx_lb_config, prefix,tenant) vs_converter = VsConfigConv(nsxt_attributes,object_merge_check, merge_object_mapping,sys_dict, - nsxt_ip, nsxt_passord) + nsxt_ip, nsxt_password) vs_converter.convert(avi_config_dict, nsx_lb_config, prefix, tenant, vs_state, controller_version, traffic_enabled, cloud_tenant, ssh_root_password, nsxt_util, migration_input_config, diff --git a/python/avi/migrationtools/nsxt_converter/nsxt_converter.py b/python/avi/migrationtools/nsxt_converter/nsxt_converter.py index e0bfa5ad8f..55ee0b4645 100755 --- a/python/avi/migrationtools/nsxt_converter/nsxt_converter.py +++ b/python/avi/migrationtools/nsxt_converter/nsxt_converter.py @@ -76,7 +76,7 @@ def __init__(self, args): self.cloud_tenant = args.cloud_tenant self.ssh_root_password = args.ssh_root_password - def conver_lb_config(self, args): + def convert_lb_config(self, args): try: if not os.path.exists(self.output_file_path): @@ -399,7 +399,7 @@ def convert(self, alb_config, output_path): parser.add_argument('-i', '--default_params_file', help='absolute path for nsx-t default params file') parser.add_argument('-n', '--nsxt_ip', - help='Ip of NSXT', required=True) + help='Ip of NSX-T', required=True) parser.add_argument('-u', '--nsxt_user', help='NSX-T User name', required=True) parser.add_argument('-p', '--nsxt_password', @@ -462,7 +462,7 @@ def convert(self, alb_config, output_path): if os.environ.get('ssh_root_password'): args.ssh_root_password = os.environ.get('ssh_root_password') nsxt_converter = NsxtConverter(args) - nsxt_converter.conver_lb_config(args) + nsxt_converter.convert_lb_config(args) end = datetime.now() print("The time of execution of above program is :", str(end - start)) diff --git a/python/avi/migrationtools/nsxt_converter/nsxt_rollback.py b/python/avi/migrationtools/nsxt_converter/nsxt_rollback.py index 5a82af60fe..2ccf320f4a 100755 --- a/python/avi/migrationtools/nsxt_converter/nsxt_rollback.py +++ b/python/avi/migrationtools/nsxt_converter/nsxt_rollback.py @@ -30,7 +30,7 @@ def __init__(self, args): ''' self.nsxt_ip = args.nsxt_ip self.nsxt_user = args.nsxt_user - self.nsxt_passord = args.nsxt_password + self.nsxt_password = args.nsxt_password self.nsxt_port = args.nsxt_port self.controller_ip = args.alb_controller_ip @@ -87,7 +87,7 @@ def initiate_rollback(self): os.mkdir(self.output_file_path) self.init_logger_path() - nsx_util = NSXUtil(self.nsxt_user, self.nsxt_passord, self.nsxt_ip, self.nsxt_port, + nsx_util = NSXUtil(self.nsxt_user, self.nsxt_password, self.nsxt_ip, self.nsxt_port, self.controller_ip, self.user, self.password, self.controller_version) vs_not_found, vs_with_no_lb = nsx_util.rollback_vs(self.vs_filter, self.input_data, self.prefix, self.alb_controller_tenant) @@ -128,7 +128,7 @@ def initiate_rollback(self): help='controller password. Input ' 'prompt will appear if no value provided') parser.add_argument('-n', '--nsxt_ip', - help='Ip of NSXT', required=True) + help='Ip of NSX-T', required=True) parser.add_argument('-u', '--nsxt_user', help='NSX-T User name') parser.add_argument('-p', '--nsxt_password', diff --git a/python/avi/migrationtools/nsxt_converter/nsxt_traffic_cutover.py b/python/avi/migrationtools/nsxt_converter/nsxt_traffic_cutover.py index ada3a900bf..3e75efddfa 100755 --- a/python/avi/migrationtools/nsxt_converter/nsxt_traffic_cutover.py +++ b/python/avi/migrationtools/nsxt_converter/nsxt_traffic_cutover.py @@ -30,7 +30,7 @@ def __init__(self, args): ''' self.nsxt_ip = args.nsxt_ip self.nsxt_user = args.nsxt_user - self.nsxt_passord = args.nsxt_password + self.nsxt_password = args.nsxt_password self.nsxt_port = args.nsxt_port self.controller_ip = args.alb_controller_ip @@ -77,7 +77,7 @@ def initiate_cutover_vs(self): os.mkdir(self.output_file_path) self.init_logger_path() - nsx_util = NSXUtil(self.nsxt_user, self.nsxt_passord, self.nsxt_ip, self.nsxt_port, + nsx_util = NSXUtil(self.nsxt_user, self.nsxt_password, self.nsxt_ip, self.nsxt_port, self.controller_ip, self.user, self.password, self.controller_version) vs_not_found = nsx_util.cutover_vs(self.vs_filter, self.prefix, self.alb_controller_tenant) if vs_not_found: @@ -113,7 +113,7 @@ def initiate_cutover_vs(self): help='comma separated names of virtual services for performing cutover.\n', required=True) parser.add_argument('-n', '--nsxt_ip', - help='Ip of NSXT', required=True) + help='Ip of NSX-T', required=True) parser.add_argument('-u', '--nsxt_user', help='NSX-T User name') parser.add_argument('-p', '--nsxt_password', diff --git a/python/avi/migrationtools/nsxt_converter/nsxt_util.py b/python/avi/migrationtools/nsxt_converter/nsxt_util.py index 09feca4209..9c46b5e3f0 100755 --- a/python/avi/migrationtools/nsxt_converter/nsxt_util.py +++ b/python/avi/migrationtools/nsxt_converter/nsxt_util.py @@ -408,17 +408,17 @@ def get_cloud_type(self, avi_cloud_list, tz_id, seg_id, tier1): tz = cl["nsxt_configuration"]["data_network_config"].get("transport_zone") if cl["nsxt_configuration"]["data_network_config"].get("tz_type") == "OVERLAY": tz_type = "OVERLAY" - data_netwrk = cl["nsxt_configuration"]["data_network_config"] - if data_netwrk.get("tier1_segment_config"): - if data_netwrk["tier1_segment_config"].get("manual"): - tier1_lrs = data_netwrk["tier1_segment_config"]["manual"].get("tier1_lrs") + data_network = cl["nsxt_configuration"]["data_network_config"] + if data_network.get("tier1_segment_config"): + if data_network["tier1_segment_config"].get("manual"): + tier1_lrs = data_network["tier1_segment_config"]["manual"].get("tier1_lrs") if tier1_lrs: is_seg_present = [True for tier in tier1_lrs if get_name_and_entity(tier.get("segment_id"))[-1] == seg_id] elif cl["nsxt_configuration"]["data_network_config"].get("tz_type") == "VLAN": tz_type = "VLAN" - data_netwrk = cl["nsxt_configuration"]["data_network_config"] - vlan_seg = data_netwrk.get("vlan_segments") + data_network = cl["nsxt_configuration"]["data_network_config"] + vlan_seg = data_network.get("vlan_segments") is_seg_present = [True for seg in vlan_seg if get_name_and_entity(seg)[-1] == seg_id] if tz.find("/") != -1: tz = tz.split("/")[-1] @@ -1075,4 +1075,4 @@ def create_ip_group(self, ip_addresses_list, group_name, alb_config, prefix,tena ip_group['addrs'] = addr_list ip_group['tenant_ref'] = conv_utils.get_object_ref(tenant, 'tenant') alb_config['IpAddrGroup'].append(ip_group) - return ip_group['name'] \ No newline at end of file + return ip_group['name'] diff --git a/python/avi/migrationtools/nsxt_converter/policy_converter.py b/python/avi/migrationtools/nsxt_converter/policy_converter.py index d040ad058e..2c7ae76a1e 100644 --- a/python/avi/migrationtools/nsxt_converter/policy_converter.py +++ b/python/avi/migrationtools/nsxt_converter/policy_converter.py @@ -134,7 +134,7 @@ def convert(self, lb_vs_config, alb_vs_config, alb_config, nsx_lb_config, nsxt_u phase = policy.get("phase") actions = policy.get("actions") # if check all type of matches if any one not supported then check match_strategy is ALL - # then skip other migrate whaterver supported + # then skip other migrate whatever supported if match_strategy == "ALL" and match_conditions: na_match_list = list(filter(lambda x: x["type"] in self.rule_match_na, match_conditions)) if len(na_match_list) > 0: @@ -1101,4 +1101,4 @@ def unable_session_reuse_in_ssl_profile(self): client_ssl_ref = self.alb_vs_config.get('ssl_profile_ref') client_ssl_name = client_ssl_ref.split('name=')[1] ssl_config = [config for config in self.alb_config["SSLProfile"] if config['name'] == client_ssl_name ] - ssl_config[0]['enable_ssl_session_reuse'] = False \ No newline at end of file + ssl_config[0]['enable_ssl_session_reuse'] = False diff --git a/python/avi/migrationtools/nsxt_converter/pools_converter.py b/python/avi/migrationtools/nsxt_converter/pools_converter.py index d447926925..ddbbfe1e70 100755 --- a/python/avi/migrationtools/nsxt_converter/pools_converter.py +++ b/python/avi/migrationtools/nsxt_converter/pools_converter.py @@ -130,7 +130,7 @@ def convert(self, alb_config, nsx_lb_config, nsxt_util, prefix, tenant): if pool_skip: skipped_pools_list.append(name) - skip_msg = 'Member ip not falling in segment rnge' + skip_msg = 'Member ip not falling in segment range' conv_utils.add_status_row('pool', None, lb_pl['display_name'], conv_const.STATUS_SKIPPED, skip_msg) LOG.warning("POOL {} not migrated. Reason: {}".format(name, diff --git a/python/avi/migrationtools/nsxt_converter/test/test_migrationtool.py b/python/avi/migrationtools/nsxt_converter/test/test_migrationtool.py index 27e98307e1..28c937966f 100644 --- a/python/avi/migrationtools/nsxt_converter/test/test_migrationtool.py +++ b/python/avi/migrationtools/nsxt_converter/test/test_migrationtool.py @@ -92,7 +92,7 @@ def Nsxt_conv(nsxt_ip=None, nsxt_user=None, nsxt_password=None, ssh_root_passwor traffic_enabled=traffic_enabled, default_params_file=default_params_file, cloud_tenant=cloud_tenant ) nsxt_converter = NsxtConverter(args) - nsxt_converter.conver_lb_config(args) + nsxt_converter.convert_lb_config(args) class TestNSXTConverter: diff --git a/python/avi/migrationtools/nsxt_converter/test/test_nsxt_functional.py b/python/avi/migrationtools/nsxt_converter/test/test_nsxt_functional.py index d470cf12f3..e967da3a43 100644 --- a/python/avi/migrationtools/nsxt_converter/test/test_nsxt_functional.py +++ b/python/avi/migrationtools/nsxt_converter/test/test_nsxt_functional.py @@ -105,7 +105,7 @@ def Nsxt_conv(nsxt_ip=None, nsxt_user=None, nsxt_password=None, ssh_root_passwor traffic_enabled=traffic_enabled, default_params_file=default_params_file, cloud_tenant=cloud_tenant ) nsxt_converter = NsxtConverter(args) - nsxt_converter.conver_lb_config(args) + nsxt_converter.convert_lb_config(args) class TestNSXTConverter: