summaryrefslogtreecommitdiff
path: root/tests/unittests/test_handler/test_handler_snappy.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-03-31 14:20:00 -0400
committerScott Moser <smoser@ubuntu.com>2015-03-31 14:20:00 -0400
commit8165000c3975db07cb5b8b29410635dd6c9345bd (patch)
tree4d445f0902a4ad8abf6666191a9ec24513ed2e66 /tests/unittests/test_handler/test_handler_snappy.py
parent25e57d42bb0a3c5d1c424cb73a40b5419a4676bd (diff)
downloadvyos-cloud-init-8165000c3975db07cb5b8b29410635dd6c9345bd.tar.gz
vyos-cloud-init-8165000c3975db07cb5b8b29410635dd6c9345bd.zip
adjust cc_snappy for snappy install package with config.
It was believed that to install a package with config the command was: snappy install --config=config-file <package> Instead, what was implemented in snappy was: snappy install <package> [<config-file>] This modifies cloud-init to invoke the latter and changes the tests appropriately. LP: #1438836
Diffstat (limited to 'tests/unittests/test_handler/test_handler_snappy.py')
-rw-r--r--tests/unittests/test_handler/test_handler_snappy.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/unittests/test_handler/test_handler_snappy.py b/tests/unittests/test_handler/test_handler_snappy.py
index 8effd99d..f3109bac 100644
--- a/tests/unittests/test_handler/test_handler_snappy.py
+++ b/tests/unittests/test_handler/test_handler_snappy.py
@@ -53,15 +53,17 @@ class TestInstallPackages(t_help.TestCase):
config = None
pkg = None
for arg in args[2:]:
- if arg.startswith("--config="):
- cfgfile = arg.partition("=")[2]
+ if arg.startswith("-"):
+ continue
+ if not pkg:
+ pkg = arg
+ elif not config:
+ cfgfile = arg
if cfgfile == "-":
config = kwargs.get('data', '')
elif cfgfile:
with open(cfgfile, "rb") as fp:
config = yaml.safe_load(fp.read())
- elif not pkg and not arg.startswith("-"):
- pkg = arg
self.snapcmds.append(['install', pkg, config])
def test_package_ops_1(self):