diff --git a/devstack/tools/nsxv_cleanup.py b/devstack/tools/nsxv_cleanup.py index 7b3fff1552..22a40eb57b 100755 --- a/devstack/tools/nsxv_cleanup.py +++ b/devstack/tools/nsxv_cleanup.py @@ -187,7 +187,7 @@ class VSMClient(object): endpoint = '/vdn/virtualwires/%s' % ls['objectId'] response = self.delete(endpoint=endpoint) if response.status_code != 200: - print "ERROR: reponse status code %s" % response.status_code + print "ERROR: response status code %s" % response.status_code def query_all_firewall_sections(self): firewall_sections = [] @@ -217,7 +217,7 @@ class VSMClient(object): l3sec['id'] response = self.delete(endpoint=endpoint) if response.status_code != 204: - print "ERROR: reponse status code %s" % response.status_code + print "ERROR: response status code %s" % response.status_code def query_all_security_groups(self): security_groups = [] @@ -247,7 +247,7 @@ class VSMClient(object): params = {'force': self.force} response = self.delete(endpoint=endpoint, params=params) if response.status_code != 200: - print "ERROR: reponse status code %s" % response.status_code + print "ERROR: response status code %s" % response.status_code def query_all_spoofguard_policies(self): self.__set_api_version('4.0') @@ -303,7 +303,7 @@ class VSMClient(object): endpoint = '/edges/%s' % edge['id'] response = self.delete(endpoint=endpoint) if response.status_code != 204: - print "ERROR: reponse status code %s" % response.status_code + print "ERROR: response status code %s" % response.status_code def cleanup_all(self): self.cleanup_firewall_section() diff --git a/etc/nsx.ini b/etc/nsx.ini index a0ffaabf4c..143c8a3e17 100644 --- a/etc/nsx.ini +++ b/etc/nsx.ini @@ -160,7 +160,7 @@ # It limits the router types that the Nsxv can support for tenants: # distributed: router is supported by distributed edge at the backend. # shared: multiple routers share the same service edge at the backend. -# exclusive: router exclusivly occupies one service edge at the backend. +# exclusive: router exclusively occupies one service edge at the backend. # Nsxv would select the first available router type from tenant_router_types # list if router-type is not specified. # If the tenant defines the router type with "--distributed", diff --git a/tools/check_bash.sh b/tools/check_bash.sh index e9d178eeb7..6fa95188ec 100644 --- a/tools/check_bash.sh +++ b/tools/check_bash.sh @@ -17,7 +17,7 @@ # under the License. # The purpose of this script is to avoid casual introduction of more -# bash dependency. Please consider alternatives before commiting code +# bash dependency. Please consider alternatives before committing code # which uses bash specific features. # Ignore comments, but include shebangs diff --git a/vmware_nsx/common/sync.py b/vmware_nsx/common/sync.py index db48fc2eef..2e4c6b2f77 100644 --- a/vmware_nsx/common/sync.py +++ b/vmware_nsx/common/sync.py @@ -60,7 +60,7 @@ class NsxCache(object): """ def __init__(self): - # Maps a uuid to the dict containing it + # Maps an uuid to the dict containing it self._uuid_dict_mappings = {} # Dicts for NSX cached resources self._lswitches = {} @@ -110,7 +110,7 @@ class NsxCache(object): resources[item_id]['hit'] = True resources[item_id]['changed'] = True resources[item_id]['data'] = item - # add a uuid to dict mapping for easy retrieval + # add an uuid to dict mapping for easy retrieval # with __getitem__ self._uuid_dict_mappings[item_id] = resources LOG.debug("Added item %s to NSX object cache", item_id) @@ -550,7 +550,7 @@ class NsxSynchronizer(): 'num_requests': num_requests, 'max_page_size': MAX_PAGE_SIZE}) # Only the first request might return the total size, - # subsequent requests will definetely not + # subsequent requests will definitely not results, cursor, total_size = nsxlib.get_single_query_page( uri, self._cluster, cursor, min(page_size, MAX_PAGE_SIZE)) diff --git a/vmware_nsx/db/nsxv_db.py b/vmware_nsx/db/nsxv_db.py index 3dd2c5b59b..630d52b212 100644 --- a/vmware_nsx/db/nsxv_db.py +++ b/vmware_nsx/db/nsxv_db.py @@ -163,7 +163,7 @@ def clean_edge_vnic_binding(session, edge_id): def allocate_edge_vnic(session, edge_id, network_id): - """Allocate an avaliable edge vnic to network.""" + """Allocate an available edge vnic to network.""" with session.begin(subtransactions=True): bindings = (session.query(nsxv_models.NsxvEdgeVnicBinding). @@ -181,7 +181,7 @@ def allocate_edge_vnic(session, edge_id, network_id): def allocate_edge_vnic_with_tunnel_index(session, edge_id, network_id): - """Allocate an avaliable edge vnic with tunnel index to network.""" + """Allocate an available edge vnic with tunnel index to network.""" # TODO(berlin): temporary solution to let metadata and dhcp use # different vnics diff --git a/vmware_nsx/nsx_cluster.py b/vmware_nsx/nsx_cluster.py index 005f0e24a0..87279de5ff 100644 --- a/vmware_nsx/nsx_cluster.py +++ b/vmware_nsx/nsx_cluster.py @@ -25,7 +25,7 @@ DEFAULT_PORT = 443 # Raise if one of those attributes is not specified REQUIRED_ATTRIBUTES = ['default_tz_uuid', 'nsx_user', 'nsx_password', 'nsx_controllers'] -# Emit a INFO log if one of those attributes is not specified +# Emit an INFO log if one of those attributes is not specified IMPORTANT_ATTRIBUTES = ['default_l3_gw_service_uuid'] # Deprecated attributes DEPRECATED_ATTRIBUTES = ['metadata_dhcp_host_route', diff --git a/vmware_nsx/plugins/nsx_mh/plugin.py b/vmware_nsx/plugins/nsx_mh/plugin.py index f85707a4bb..6f679506b7 100644 --- a/vmware_nsx/plugins/nsx_mh/plugin.py +++ b/vmware_nsx/plugins/nsx_mh/plugin.py @@ -309,7 +309,7 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin, context.session, self.cluster, router_id) if remove_snat_rules: # Be safe and concede NAT rules might not exist. - # Therefore use min_num_expected=0 + # Therefore, use min_num_expected=0 for cidr in cidrs: routerlib.delete_nat_rules_by_match( self.cluster, nsx_router_id, "SourceNatRule", @@ -1907,7 +1907,7 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin, internal_subnet_cidr, 'destination_ip_addresses': internal_ip}) - # setup snat rule such that src ip of a IP packet when + # setup snat rule such that src ip of an IP packet when # using floating is the floating ip itself. routerlib.create_lrouter_snat_rule( self.cluster, nsx_router_id, floating_ip, floating_ip, diff --git a/vmware_nsx/plugins/nsx_v/plugin.py b/vmware_nsx/plugins/nsx_v/plugin.py index 88864ba0ae..c7ce4537af 100644 --- a/vmware_nsx/plugins/nsx_v/plugin.py +++ b/vmware_nsx/plugins/nsx_v/plugin.py @@ -1391,7 +1391,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin, def _validate_router_size(self, router): # Check if router-size is specified. router-size can only be specified - # for a exclusive non-distributed router; else raise a BadRequest + # for an exclusive non-distributed router; else raise a BadRequest # exception. r = router['router'] if attr.is_attr_set(r.get(ROUTER_SIZE)): diff --git a/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py index 698a591984..ba7c7fe301 100644 --- a/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py +++ b/vmware_nsx/plugins/nsx_v/vshield/edge_utils.py @@ -478,7 +478,7 @@ class EdgeManager(object): def _allocate_edge_appliance(self, context, resource_id, name, appliance_size=nsxv_constants.LARGE, dist=False): - """Try to allocate one avaliable edge from pool.""" + """Try to allocate one available edge from pool.""" edge_type = (nsxv_constants.VDR_EDGE if dist else nsxv_constants.SERVICE_EDGE) @@ -502,7 +502,7 @@ class EdgeManager(object): self._clean_all_error_edge_bindings(context) available_router_binding = self._get_available_router_binding( context, appliance_size=appliance_size, edge_type=edge_type) - # Synchronously deploy an edge if no avaliable edge in pool. + # Synchronously deploy an edge if no available edge in pool. if not available_router_binding: # store router-edge mapping binding nsxv_db.add_nsxv_router_binding( @@ -518,7 +518,7 @@ class EdgeManager(object): LOG.debug("Select edge: %(edge_id)s from pool for %(name)s", {'edge_id': available_router_binding['edge_id'], 'name': name}) - # select the first avaliable edge in pool. + # select the first available edge in pool. nsxv_db.delete_nsxv_router_binding( context.session, available_router_binding['router_id']) nsxv_db.add_nsxv_router_binding( @@ -1551,7 +1551,7 @@ def update_internal_interface(nsxv_manager, context, router_id, int_net_id, edge_id = binding['edge_id'] edge_vnic_binding = nsxv_db.get_edge_vnic_binding( context.session, edge_id, int_net_id) - # if edge_vnic_binding is None, then first select one avaliable + # if edge_vnic_binding is None, then first select one available # internal vnic for connection. if not edge_vnic_binding: edge_vnic_binding = nsxv_db.allocate_edge_vnic( diff --git a/vmware_nsx/plugins/nsx_v3/plugin.py b/vmware_nsx/plugins/nsx_v3/plugin.py index ce396d7adc..b20a79e29b 100644 --- a/vmware_nsx/plugins/nsx_v3/plugin.py +++ b/vmware_nsx/plugins/nsx_v3/plugin.py @@ -428,7 +428,7 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin, if not self._network_is_external(context, network_id): # TODO(salv-orlando): Handle backend failure, possibly without # requiring us to un-delete the DB object. For instance, ignore - # failures occuring if logical switch is not found + # failures occurring if logical switch is not found nsxlib.delete_logical_switch(network_id) else: # TODO(berlin): delete subnets public announce on the network @@ -1375,7 +1375,7 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin, tags, operation=firewall.INSERT_BEFORE, other_section=self.default_section)) - # REVISIT(roeyc): Idealy, at this point we need not be under an + # REVISIT(roeyc): Ideally, at this point we need not be under an # open db transactions, however, unittests fail if omitting # subtransactions=True. with context.session.begin(subtransactions=True): diff --git a/vmware_nsx/tests/unit/nsx_mh/test_plugin.py b/vmware_nsx/tests/unit/nsx_mh/test_plugin.py index 91decb0966..6d4bcc5710 100644 --- a/vmware_nsx/tests/unit/nsx_mh/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_mh/test_plugin.py @@ -661,7 +661,7 @@ class TestL3NatTestCase(L3NatTest, def test_router_add_gateway_invalid_network_returns_404(self): # NOTE(salv-orlando): This unit test has been overridden # as the nsx plugin support the ext_gw_mode extension - # which mandates a uuid for the external network identifier + # which mandates an uuid for the external network identifier with self.router() as r: self._add_external_gateway_to_router( r['router']['id'], diff --git a/vmware_nsx/tests/unit/nsx_v/test_plugin.py b/vmware_nsx/tests/unit/nsx_v/test_plugin.py index b2760578e9..2c25f3fe38 100644 --- a/vmware_nsx/tests/unit/nsx_v/test_plugin.py +++ b/vmware_nsx/tests/unit/nsx_v/test_plugin.py @@ -836,7 +836,7 @@ class TestPortsV2(NsxVPluginV2TestCase, self.assertEqual(len(ips), 1) self.assertEqual(ips[0]['ip_address'], '10.0.0.2') self.assertEqual(ips[0]['subnet_id'], subnet['subnet']['id']) - # Request a IP from specific subnet + # Request an IP from specific subnet kwargs = {"fixed_ips": [{'subnet_id': subnet['subnet']['id']}]} net_id = port['port']['network_id'] res = self._create_port(self.fmt, net_id=net_id, **kwargs) @@ -849,7 +849,7 @@ class TestPortsV2(NsxVPluginV2TestCase, def test_requested_subnet_id_v4_and_v6(self): with self.subnet(enable_dhcp=False) as subnet: - # Get a IPv4 and IPv6 address + # Get an IPv4 and IPv6 address tenant_id = subnet['subnet']['tenant_id'] net_id = subnet['subnet']['network_id'] res = self._create_subnet( @@ -1104,7 +1104,7 @@ class TestSubnetsV2(NsxVPluginV2TestCase, self.assertEqual('17.129.122.5/32', subnet['subnet']['cidr']) def test_create_subnet_ipv6_attributes(self): - # Expected to fail for now as we dont't support IPv6 for NSXv + # Expected to fail for now as we don't support IPv6 for NSXv cidr = "fe80::/80" with testlib_api.ExpectedException( webob.exc.HTTPClientError) as ctx_manager: @@ -1974,9 +1974,9 @@ class TestExclusiveRouterTestCase(L3NatTest, L3NatTestCaseBase, self.assertEqual("BadRequest", router['NeutronError']['type']) def test_router_add_gateway_invalid_network_returns_404(self): - # NOTE(salv-orlando): This unit test has been overriden + # NOTE(salv-orlando): This unit test has been overridden # as the nsx plugin support the ext_gw_mode extension - # which mandates a uuid for the external network identifier + # which mandates an uuid for the external network identifier with self.router() as r: self._add_external_gateway_to_router( r['router']['id'], @@ -2523,11 +2523,11 @@ class TestNSXPortSecurity(test_psec.TestPortSecurity, super(TestNSXPortSecurity, self).setUp(plugin=plugin) def test_create_port_fails_with_secgroup_and_port_security_false(self): - # Security Gropus can be used even when port-security is disabled + # Security Groups can be used even when port-security is disabled pass def test_update_port_security_off_with_security_group(self): - # Security Gropus can be used even when port-security is disabled + # Security Groups can be used even when port-security is disabled pass def test_create_port_security_overrides_network_value(self): diff --git a/vmware_nsx/tests/unit/nsx_v/vshield/fake_vcns.py b/vmware_nsx/tests/unit/nsx_v/vshield/fake_vcns.py index e475c09725..1e88bdec41 100644 --- a/vmware_nsx/tests/unit/nsx_v/vshield/fake_vcns.py +++ b/vmware_nsx/tests/unit/nsx_v/vshield/fake_vcns.py @@ -833,7 +833,7 @@ class FakeVcns(object): return (headers, response) def _unknown_error(self): - msg = "Unknown Error Occured.Please look into tech support logs." + msg = "Unknown Error Occurred.Please look into tech support logs." response = self._get_bad_req_response(msg, 100046, 'vShield App') headers = {'status': 400} return (headers, response)