Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
advornic committed Feb 9, 2015
1 parent 8492a11 commit e6193bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/actions/test_run_cli_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ def test_failure(self):
try:
self.failUnless(eapi_log()[-1] == contents)
self.failUnless(bootstrap.action_failure())
self.failUnless('Running CLI commands failed' in
bootstrap.output)
self.failUnless('Running CLI commands [\'%s\'] failed' %
contents in bootstrap.output)
except AssertionError as assertion:
print 'Output: %s' % bootstrap.output
print 'Error: %s' % bootstrap.error
Expand Down
11 changes: 7 additions & 4 deletions ztpserver/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,9 @@ def load_pattern(pattern, content_type=CONTENT_TYPE_YAML, node_id=None):
if not isinstance(pattern, collections.Mapping):
pattern = load_file(pattern, content_type,
node_id)
pattern['config_handler'] = pattern['config-handler']
del pattern['config-handler']
if 'config-handler' in pattern:
pattern['config_handler'] = pattern['config-handler']
del pattern['config-handler']

# add dummy values to pass validation
for dummy in ['definition', 'name', 'config_handler']:
Expand Down Expand Up @@ -374,8 +375,10 @@ def add_pattern(self, name, **kwargs):
kwargs['node_id'] = self.node_id
kwargs['name'] = name

kwargs['config_handler'] = kwargs.get('config-handler')
del kwargs['config-handler']
kwargs['config_handler'] = kwargs.get('config-handler',
None)
if 'config-handler' in kwargs:
del kwargs['config-handler']
kwargs['interfaces'] = kwargs.get('interfaces', list())
kwargs['variables'] = kwargs.get('variables', dict())

Expand Down

0 comments on commit e6193bc

Please sign in to comment.