mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
commit
4947bd9c4c
@ -1022,8 +1022,9 @@ def _create_eni(interface, eip=None):
|
||||
break
|
||||
|
||||
if not found:
|
||||
raise SaltCloudConfigError('No such subnet <%s>' %
|
||||
interface['SubnetId'])
|
||||
raise SaltCloudConfigError(
|
||||
'No such subnet <{0}>'.format(interface['SubnetId'])
|
||||
)
|
||||
|
||||
params = {'Action': 'CreateNetworkInterface',
|
||||
'SubnetId': interface['SubnetId']}
|
||||
@ -1040,7 +1041,7 @@ def _create_eni(interface, eip=None):
|
||||
result = query(params, return_root=True)
|
||||
eni_desc = result[1]
|
||||
if not eni_desc or not eni_desc.get('networkInterfaceId'):
|
||||
raise SaltCloudException('Failed to create interface: %s' % result)
|
||||
raise SaltCloudException('Failed to create interface: {0}'.format(result))
|
||||
|
||||
eni_id = eni_desc.get('networkInterfaceId')
|
||||
log.debug(
|
||||
@ -1127,9 +1128,12 @@ def _associate_eip_with_interface(eni_id, eip_id, private_ip=None):
|
||||
|
||||
return result[2].get('associationId')
|
||||
|
||||
raise SaltCloudException('Could not associate elastic ip address ' +
|
||||
'<%s> with network interface <%s>' %
|
||||
(eip_id, eni_id))
|
||||
raise SaltCloudException(
|
||||
'Could not associate elastic ip address '
|
||||
'<{0}> with network interface <{1}>'.format(
|
||||
eip_id, eni_id
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def _update_enis(interfaces, instance):
|
||||
|
@ -295,10 +295,10 @@ class SaltRaetRoadStackManager(ioflo.base.deeding.Deed):
|
||||
Ioinits = odict(
|
||||
inode=".raet.udp.stack.",
|
||||
stack='stack',
|
||||
alloweds = {'ipath': '.salt.var.presence.alloweds',
|
||||
'ival': odict()},
|
||||
changeds = {'ipath': '.salt.var.presence.changed',
|
||||
'ival': odict(plus=set(), minus=set())},)
|
||||
alloweds={'ipath': '.salt.var.presence.alloweds',
|
||||
'ival': odict()},
|
||||
changeds={'ipath': '.salt.var.presence.changed',
|
||||
'ival': odict(plus=set(), minus=set())},)
|
||||
|
||||
def action(self, **kwa):
|
||||
'''
|
||||
@ -307,7 +307,7 @@ class SaltRaetRoadStackManager(ioflo.base.deeding.Deed):
|
||||
stack = self.stack.value
|
||||
if stack and isinstance(stack, RoadStack):
|
||||
stack.manage(cascade=True)
|
||||
self.alloweds.value = odict(self.stack.value.alloweds) #make copy
|
||||
self.alloweds.value = odict(self.stack.value.alloweds) # make copy
|
||||
self.changeds.data.plus = set(self.stack.value.changeds['plus'])
|
||||
self.changeds.data.minus = set(self.stack.value.changeds['minus'])
|
||||
|
||||
@ -316,7 +316,6 @@ class SaltRaetRoadStackManager(ioflo.base.deeding.Deed):
|
||||
# plus is set of newly allowed remotes
|
||||
# minus is set of newly unallowed remotes
|
||||
|
||||
|
||||
# need to queue presence event message if either plus or minus is not empty
|
||||
|
||||
|
||||
|
@ -131,7 +131,7 @@ __ssl_options__ = __ssl_options_parameterized__ + [
|
||||
# are database names, table names and column names. Theses names are not values
|
||||
# and do not follow the same escape rules (see quote_identifier function for
|
||||
# details on `_ and % escape policies on identifiers). Using value escaping on
|
||||
# identifier could fool the SQL engine (badly escaping quotes and not doubling
|
||||
# identifier could fool the SQL engine (badly escaping quotes and not doubling
|
||||
# ` characters. So for identifiers a call to quote_identifier should be done and
|
||||
# theses identifiers should then be added in strings with format, but without
|
||||
# __repr__ filter.
|
||||
|
@ -5,7 +5,7 @@ from tests.utils import BaseRestCherryPyTest
|
||||
|
||||
# Import 3rd-party libs
|
||||
try:
|
||||
import cherrypy
|
||||
import cherrypy # pylint: disable=W0611
|
||||
HAS_CHERRYPY = True
|
||||
except ImportError:
|
||||
HAS_CHERRYPY = False
|
||||
|
Loading…
Reference in New Issue
Block a user