Skip to content

Commit

Permalink
chore: fix the misspelled words
Browse files Browse the repository at this point in the history
  • Loading branch information
ichisuke55 committed Dec 23, 2022
1 parent b69d84f commit b670d8b
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions python/avi/migrationtools/avi_migration_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'])
Expand Down
2 changes: 1 addition & 1 deletion python/avi/migrationtools/custom_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
2 changes: 1 addition & 1 deletion python/avi/migrationtools/nsxt_converter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/avi/migrationtools/nsxt_converter/monitor_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions python/avi/migrationtools/nsxt_converter/nsxt_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions python/avi/migrationtools/nsxt_converter/nsxt_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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))
6 changes: 3 additions & 3 deletions python/avi/migrationtools/nsxt_converter/nsxt_rollback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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',
Expand Down
14 changes: 7 additions & 7 deletions python/avi/migrationtools/nsxt_converter/nsxt_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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']
return ip_group['name']
4 changes: 2 additions & 2 deletions python/avi/migrationtools/nsxt_converter/policy_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
ssl_config[0]['enable_ssl_session_reuse'] = False
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit b670d8b

Please sign in to comment.