diff options
author | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-05-23 10:50:17 +0200 |
---|---|---|
committer | Marcel Enguehard <mengueha+fdio@cisco.com> | 2017-05-23 08:57:12 +0000 |
commit | be0b435d307173598c30fcacc421b17112137099 (patch) | |
tree | ed8aae7eef796eb7381d21937b095a036733789a /vicn/resource/node.py | |
parent | 895a6328d6e64948ed213e8fbbb3ab15aca0df43 (diff) |
Introduced groups + lxd profiles + diverted control network handling to lxd + misc bug fixes
Change-Id: Iae26bc2994ac9704dde7dfa8fbe4be1b74cf9e6f
Signed-off-by: Marcel Enguehard <mengueha+fdio@cisco.com>
Diffstat (limited to 'vicn/resource/node.py')
-rw-r--r-- | vicn/resource/node.py | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/vicn/resource/node.py b/vicn/resource/node.py index ad519666..c785e32b 100644 --- a/vicn/resource/node.py +++ b/vicn/resource/node.py @@ -61,33 +61,17 @@ class Node(Resource): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self._host_interface = None + self._management_interface = None #--------------------------------------------------------------------------- # Public API #--------------------------------------------------------------------------- @property - def host_interface(self): - """ - We assume that any unmanaged interface associated to the host is the - main host interface. It should thus be declared in the JSON topology. - We might later perform some kind of auto discovery. - - This unmanaged interface is only required to get the device_name: - - to create Veth (need a parent) - - to ssh a node, get its ip address (eg for the repo) - - to avoid loops in type specification - - It is used for all nodes to provide network connectivity. - """ - - for interface in self.interfaces: - if not interface.managed or interface.owner is not None: - return interface - - raise Exception('Cannot find host interface for node {}: {}'.format( - self, self.interfaces)) + def management_interface(self): + if not self._management_interface: + raise Exception("No management interface has been defined") + return self._management_interface def execute(self, command, output = False, as_root = False): raise NotImplementedError |