Fix typos with topy

$ topy -a vmware-nsx

Change-Id: I681a842b4d9309d499052f33cf756228ad850113
This commit is contained in:
Aaron Rosen 2015-11-18 23:39:35 -08:00
parent 402c3bb90a
commit 97eef172cf
13 changed files with 30 additions and 30 deletions

View File

@ -187,7 +187,7 @@ class VSMClient(object):
endpoint = '/vdn/virtualwires/%s' % ls['objectId'] endpoint = '/vdn/virtualwires/%s' % ls['objectId']
response = self.delete(endpoint=endpoint) response = self.delete(endpoint=endpoint)
if response.status_code != 200: 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): def query_all_firewall_sections(self):
firewall_sections = [] firewall_sections = []
@ -217,7 +217,7 @@ class VSMClient(object):
l3sec['id'] l3sec['id']
response = self.delete(endpoint=endpoint) response = self.delete(endpoint=endpoint)
if response.status_code != 204: 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): def query_all_security_groups(self):
security_groups = [] security_groups = []
@ -247,7 +247,7 @@ class VSMClient(object):
params = {'force': self.force} params = {'force': self.force}
response = self.delete(endpoint=endpoint, params=params) response = self.delete(endpoint=endpoint, params=params)
if response.status_code != 200: 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): def query_all_spoofguard_policies(self):
self.__set_api_version('4.0') self.__set_api_version('4.0')
@ -303,7 +303,7 @@ class VSMClient(object):
endpoint = '/edges/%s' % edge['id'] endpoint = '/edges/%s' % edge['id']
response = self.delete(endpoint=endpoint) response = self.delete(endpoint=endpoint)
if response.status_code != 204: 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): def cleanup_all(self):
self.cleanup_firewall_section() self.cleanup_firewall_section()

View File

@ -160,7 +160,7 @@
# It limits the router types that the Nsxv can support for tenants: # It limits the router types that the Nsxv can support for tenants:
# distributed: router is supported by distributed edge at the backend. # distributed: router is supported by distributed edge at the backend.
# shared: multiple routers share the same service 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 # Nsxv would select the first available router type from tenant_router_types
# list if router-type is not specified. # list if router-type is not specified.
# If the tenant defines the router type with "--distributed", # If the tenant defines the router type with "--distributed",

View File

@ -17,7 +17,7 @@
# under the License. # under the License.
# The purpose of this script is to avoid casual introduction of more # 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. # which uses bash specific features.
# Ignore comments, but include shebangs # Ignore comments, but include shebangs

View File

@ -60,7 +60,7 @@ class NsxCache(object):
""" """
def __init__(self): def __init__(self):
# Maps a uuid to the dict containing it # Maps an uuid to the dict containing it
self._uuid_dict_mappings = {} self._uuid_dict_mappings = {}
# Dicts for NSX cached resources # Dicts for NSX cached resources
self._lswitches = {} self._lswitches = {}
@ -110,7 +110,7 @@ class NsxCache(object):
resources[item_id]['hit'] = True resources[item_id]['hit'] = True
resources[item_id]['changed'] = True resources[item_id]['changed'] = True
resources[item_id]['data'] = item 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__ # with __getitem__
self._uuid_dict_mappings[item_id] = resources self._uuid_dict_mappings[item_id] = resources
LOG.debug("Added item %s to NSX object cache", item_id) LOG.debug("Added item %s to NSX object cache", item_id)
@ -550,7 +550,7 @@ class NsxSynchronizer():
'num_requests': num_requests, 'num_requests': num_requests,
'max_page_size': MAX_PAGE_SIZE}) 'max_page_size': MAX_PAGE_SIZE})
# Only the first request might return the total 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( results, cursor, total_size = nsxlib.get_single_query_page(
uri, self._cluster, cursor, uri, self._cluster, cursor,
min(page_size, MAX_PAGE_SIZE)) min(page_size, MAX_PAGE_SIZE))

View File

@ -163,7 +163,7 @@ def clean_edge_vnic_binding(session, edge_id):
def allocate_edge_vnic(session, edge_id, network_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): with session.begin(subtransactions=True):
bindings = (session.query(nsxv_models.NsxvEdgeVnicBinding). 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): 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 # TODO(berlin): temporary solution to let metadata and dhcp use
# different vnics # different vnics

View File

@ -25,7 +25,7 @@ DEFAULT_PORT = 443
# Raise if one of those attributes is not specified # Raise if one of those attributes is not specified
REQUIRED_ATTRIBUTES = ['default_tz_uuid', 'nsx_user', REQUIRED_ATTRIBUTES = ['default_tz_uuid', 'nsx_user',
'nsx_password', 'nsx_controllers'] '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'] IMPORTANT_ATTRIBUTES = ['default_l3_gw_service_uuid']
# Deprecated attributes # Deprecated attributes
DEPRECATED_ATTRIBUTES = ['metadata_dhcp_host_route', DEPRECATED_ATTRIBUTES = ['metadata_dhcp_host_route',

View File

@ -309,7 +309,7 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
context.session, self.cluster, router_id) context.session, self.cluster, router_id)
if remove_snat_rules: if remove_snat_rules:
# Be safe and concede NAT rules might not exist. # 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: for cidr in cidrs:
routerlib.delete_nat_rules_by_match( routerlib.delete_nat_rules_by_match(
self.cluster, nsx_router_id, "SourceNatRule", self.cluster, nsx_router_id, "SourceNatRule",
@ -1907,7 +1907,7 @@ class NsxPluginV2(addr_pair_db.AllowedAddressPairsMixin,
internal_subnet_cidr, internal_subnet_cidr,
'destination_ip_addresses': 'destination_ip_addresses':
internal_ip}) 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. # using floating is the floating ip itself.
routerlib.create_lrouter_snat_rule( routerlib.create_lrouter_snat_rule(
self.cluster, nsx_router_id, floating_ip, floating_ip, self.cluster, nsx_router_id, floating_ip, floating_ip,

View File

@ -1391,7 +1391,7 @@ class NsxVPluginV2(addr_pair_db.AllowedAddressPairsMixin,
def _validate_router_size(self, router): def _validate_router_size(self, router):
# Check if router-size is specified. router-size can only be specified # 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. # exception.
r = router['router'] r = router['router']
if attr.is_attr_set(r.get(ROUTER_SIZE)): if attr.is_attr_set(r.get(ROUTER_SIZE)):

View File

@ -478,7 +478,7 @@ class EdgeManager(object):
def _allocate_edge_appliance(self, context, resource_id, name, def _allocate_edge_appliance(self, context, resource_id, name,
appliance_size=nsxv_constants.LARGE, appliance_size=nsxv_constants.LARGE,
dist=False): 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 edge_type = (nsxv_constants.VDR_EDGE if dist else
nsxv_constants.SERVICE_EDGE) nsxv_constants.SERVICE_EDGE)
@ -502,7 +502,7 @@ class EdgeManager(object):
self._clean_all_error_edge_bindings(context) self._clean_all_error_edge_bindings(context)
available_router_binding = self._get_available_router_binding( available_router_binding = self._get_available_router_binding(
context, appliance_size=appliance_size, edge_type=edge_type) 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: if not available_router_binding:
# store router-edge mapping binding # store router-edge mapping binding
nsxv_db.add_nsxv_router_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", LOG.debug("Select edge: %(edge_id)s from pool for %(name)s",
{'edge_id': available_router_binding['edge_id'], {'edge_id': available_router_binding['edge_id'],
'name': name}) 'name': name})
# select the first avaliable edge in pool. # select the first available edge in pool.
nsxv_db.delete_nsxv_router_binding( nsxv_db.delete_nsxv_router_binding(
context.session, available_router_binding['router_id']) context.session, available_router_binding['router_id'])
nsxv_db.add_nsxv_router_binding( 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_id = binding['edge_id']
edge_vnic_binding = nsxv_db.get_edge_vnic_binding( edge_vnic_binding = nsxv_db.get_edge_vnic_binding(
context.session, edge_id, int_net_id) 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. # internal vnic for connection.
if not edge_vnic_binding: if not edge_vnic_binding:
edge_vnic_binding = nsxv_db.allocate_edge_vnic( edge_vnic_binding = nsxv_db.allocate_edge_vnic(

View File

@ -428,7 +428,7 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
if not self._network_is_external(context, network_id): if not self._network_is_external(context, network_id):
# TODO(salv-orlando): Handle backend failure, possibly without # TODO(salv-orlando): Handle backend failure, possibly without
# requiring us to un-delete the DB object. For instance, ignore # 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) nsxlib.delete_logical_switch(network_id)
else: else:
# TODO(berlin): delete subnets public announce on the network # TODO(berlin): delete subnets public announce on the network
@ -1375,7 +1375,7 @@ class NsxV3Plugin(addr_pair_db.AllowedAddressPairsMixin,
tags, operation=firewall.INSERT_BEFORE, tags, operation=firewall.INSERT_BEFORE,
other_section=self.default_section)) 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 # open db transactions, however, unittests fail if omitting
# subtransactions=True. # subtransactions=True.
with context.session.begin(subtransactions=True): with context.session.begin(subtransactions=True):

View File

@ -661,7 +661,7 @@ class TestL3NatTestCase(L3NatTest,
def test_router_add_gateway_invalid_network_returns_404(self): def test_router_add_gateway_invalid_network_returns_404(self):
# NOTE(salv-orlando): This unit test has been overridden # NOTE(salv-orlando): This unit test has been overridden
# as the nsx plugin support the ext_gw_mode extension # 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: with self.router() as r:
self._add_external_gateway_to_router( self._add_external_gateway_to_router(
r['router']['id'], r['router']['id'],

View File

@ -836,7 +836,7 @@ class TestPortsV2(NsxVPluginV2TestCase,
self.assertEqual(len(ips), 1) self.assertEqual(len(ips), 1)
self.assertEqual(ips[0]['ip_address'], '10.0.0.2') self.assertEqual(ips[0]['ip_address'], '10.0.0.2')
self.assertEqual(ips[0]['subnet_id'], subnet['subnet']['id']) 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']}]} kwargs = {"fixed_ips": [{'subnet_id': subnet['subnet']['id']}]}
net_id = port['port']['network_id'] net_id = port['port']['network_id']
res = self._create_port(self.fmt, net_id=net_id, **kwargs) 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): def test_requested_subnet_id_v4_and_v6(self):
with self.subnet(enable_dhcp=False) as subnet: 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'] tenant_id = subnet['subnet']['tenant_id']
net_id = subnet['subnet']['network_id'] net_id = subnet['subnet']['network_id']
res = self._create_subnet( res = self._create_subnet(
@ -1104,7 +1104,7 @@ class TestSubnetsV2(NsxVPluginV2TestCase,
self.assertEqual('17.129.122.5/32', subnet['subnet']['cidr']) self.assertEqual('17.129.122.5/32', subnet['subnet']['cidr'])
def test_create_subnet_ipv6_attributes(self): 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" cidr = "fe80::/80"
with testlib_api.ExpectedException( with testlib_api.ExpectedException(
webob.exc.HTTPClientError) as ctx_manager: webob.exc.HTTPClientError) as ctx_manager:
@ -1974,9 +1974,9 @@ class TestExclusiveRouterTestCase(L3NatTest, L3NatTestCaseBase,
self.assertEqual("BadRequest", router['NeutronError']['type']) self.assertEqual("BadRequest", router['NeutronError']['type'])
def test_router_add_gateway_invalid_network_returns_404(self): 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 # 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: with self.router() as r:
self._add_external_gateway_to_router( self._add_external_gateway_to_router(
r['router']['id'], r['router']['id'],
@ -2523,11 +2523,11 @@ class TestNSXPortSecurity(test_psec.TestPortSecurity,
super(TestNSXPortSecurity, self).setUp(plugin=plugin) super(TestNSXPortSecurity, self).setUp(plugin=plugin)
def test_create_port_fails_with_secgroup_and_port_security_false(self): 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 pass
def test_update_port_security_off_with_security_group(self): 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 pass
def test_create_port_security_overrides_network_value(self): def test_create_port_security_overrides_network_value(self):

View File

@ -833,7 +833,7 @@ class FakeVcns(object):
return (headers, response) return (headers, response)
def _unknown_error(self): 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') response = self._get_bad_req_response(msg, 100046, 'vShield App')
headers = {'status': 400} headers = {'status': 400}
return (headers, response) return (headers, response)