summaryrefslogtreecommitdiffstats
path: root/snaps/domain
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-07-06 11:58:52 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-07-06 11:58:52 -0600
commit5616cafabcc5f8ab75ee6fcaefa87e3fbd126ce9 (patch)
treefeeb024010654ca1889ae8231176fce083e4a41b /snaps/domain
parent815a21216c6df1a33eff7a5521ee0b08f4696822 (diff)
Added support for using '~' for SSH key location.
While testing changes, fixed problems found with querying for floating IPs which also required adding network data to the VMInst domain object. JIRA: SNAPS-85 Change-Id: I0ecf3a6885ce84fe14c4a6db09269c56dc0ad9fc Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/domain')
-rw-r--r--snaps/domain/test/vm_inst_tests.py6
-rw-r--r--snaps/domain/vm_inst.py5
2 files changed, 8 insertions, 3 deletions
diff --git a/snaps/domain/test/vm_inst_tests.py b/snaps/domain/test/vm_inst_tests.py
index e722a06..c3de8ba 100644
--- a/snaps/domain/test/vm_inst_tests.py
+++ b/snaps/domain/test/vm_inst_tests.py
@@ -23,14 +23,16 @@ class VmInstDomainObjectTests(unittest.TestCase):
"""
def test_construction_positional(self):
- vm_inst = VmInst('name', 'id')
+ vm_inst = VmInst('name', 'id', dict())
self.assertEqual('name', vm_inst.name)
self.assertEqual('id', vm_inst.id)
+ self.assertEqual(dict(), vm_inst.networks)
def test_construction_named(self):
- vm_inst = VmInst(inst_id='id', name='name')
+ vm_inst = VmInst(networks=dict(), inst_id='id', name='name')
self.assertEqual('name', vm_inst.name)
self.assertEqual('id', vm_inst.id)
+ self.assertEqual(dict(), vm_inst.networks)
class FloatingIpDomainObjectTests(unittest.TestCase):
diff --git a/snaps/domain/vm_inst.py b/snaps/domain/vm_inst.py
index 0e12d14..ae01cf0 100644
--- a/snaps/domain/vm_inst.py
+++ b/snaps/domain/vm_inst.py
@@ -19,14 +19,17 @@ class VmInst:
SNAPS domain object for Images. Should contain attributes that
are shared amongst cloud providers
"""
- def __init__(self, name, inst_id):
+ def __init__(self, name, inst_id, networks):
"""
Constructor
:param name: the image's name
:param inst_id: the instance's id
+ :param networks: dict of networks where the key is the subnet name and
+ value is a list of associated IPs
"""
self.name = name
self.id = inst_id
+ self.networks = networks
class FloatingIp: