summaryrefslogtreecommitdiffstats
path: root/apex/undercloud
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-11-27 15:22:25 -0500
committerTim Rozet <trozet@redhat.com>2018-04-04 16:03:49 -0400
commit382fa452e0c9a8189911f615416e1b24badaf5e4 (patch)
tree41973e70a7b054b4a2297bb45918430c0614c9ee /apex/undercloud
parentb047099b609eac330486f23913e8046d0f22c1ab (diff)
Adds the ability to fetch logs from deployment
Usage: opnfv-pyutil --fetch-logs python3 utils.py --fetch-logs --lib-dir ../lib Eventually all utils.sh functions will be migrated here. Note there is no support here for containers. Will be added later. Change-Id: I223b8592ad09e0370e287ee2801072db31f9aa12 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'apex/undercloud')
-rw-r--r--apex/undercloud/undercloud.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/apex/undercloud/undercloud.py b/apex/undercloud/undercloud.py
index e799d371..2972351c 100644
--- a/apex/undercloud/undercloud.py
+++ b/apex/undercloud/undercloud.py
@@ -77,15 +77,26 @@ class Undercloud:
self.inject_auth()
self._update_delorean_repo()
- def _set_ip(self):
- ip_out = self.vm.interfaceAddresses(
+ @staticmethod
+ def _get_ip(vm):
+ ip_out = vm.interfaceAddresses(
libvirt.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE, 0)
if ip_out:
for (name, val) in ip_out.items():
for ipaddr in val['addrs']:
if ipaddr['type'] == libvirt.VIR_IP_ADDR_TYPE_IPV4:
- self.ip = ipaddr['addr']
- return True
+ return ipaddr['addr']
+
+ def _set_ip(self):
+ ip = self._get_ip(self.vm)
+ if ip:
+ self.ip = ip
+ return True
+
+ @staticmethod
+ def get_ip():
+ vm = Undercloud._get_vm()
+ return Undercloud._get_ip(vm)
def start(self):
"""