summaryrefslogtreecommitdiffstats
path: root/odl-pipeline
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-02-08 14:43:22 -0500
committerTim Rozet <trozet@redhat.com>2017-02-08 14:43:22 -0500
commit9febe28877a96d6b46bea17b40d421fd3002f693 (patch)
treebb8875168e101f87af3892aa274c5a462b64ac06 /odl-pipeline
parent192e6af198cf94a678edece8ad4bb123132e9ce2 (diff)
Fixes tripleo_helper permissions
There were issues with some of the commands that need to be root. Along with logging into the undercloud when the tripleo_inspector script is ran as a non root user. Change-Id: Ie29b674bd0770759b3bcc22323b424fcc270eef6 Signed-off-by: Tim Rozet <trozet@redhat.com>
Diffstat (limited to 'odl-pipeline')
-rw-r--r--odl-pipeline/lib/utils/tripleo_helper.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/odl-pipeline/lib/utils/tripleo_helper.py b/odl-pipeline/lib/utils/tripleo_helper.py
index 702e811..f49cfe7 100644
--- a/odl-pipeline/lib/utils/tripleo_helper.py
+++ b/odl-pipeline/lib/utils/tripleo_helper.py
@@ -23,12 +23,12 @@ class TripleoHelper():
@staticmethod
def get_virtual_node_name_from_mac(mac):
vnode_names, _ = execute('virsh list|awk \'{print '
- '$2}\'', shell=True)
+ '$2}\'', shell=True, as_root=True)
for node in vnode_names.split('\n'):
if 'baremetal' in node:
admin_net_mac, _ = execute(
'virsh domiflist %s |grep admin |awk \'{print $5}\''
- % node, shell=True)
+ % node, shell=True, as_root=True)
if admin_net_mac.replace('\n', '') == mac:
return node
raise Exception('Could not find corresponding virtual node for MAC: %s'
@@ -36,13 +36,14 @@ class TripleoHelper():
@staticmethod
def get_undercloud_ip():
- out, _ = execute('virsh domifaddr undercloud', shell=True)
+ out, _ = execute('virsh domifaddr undercloud', shell=True,
+ as_root=True)
return re.findall('([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)', out)[0]
@staticmethod
def get_undercloud():
return Node('undercloud', address=TripleoHelper.get_undercloud_ip(),
- user='stack')
+ user='stack', password='stack')
class TripleOHelperException(Exception):