From eb26da97409afc992d635b71d83cc6fc4053ad48 Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Thu, 4 Aug 2016 08:11:59 +0000 Subject: [PATCH] Revert "Fix potential security issues" This reverts commit 81210539bec2d87c3f102e8fd8a5529180911dda. Change-Id: I48873df52125ff0d86dfabd8e40378a5df2cad14 --- deployment_scripts/compute_post_deployment.py | 25 ++++++++++--------- metadata.yaml | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/deployment_scripts/compute_post_deployment.py b/deployment_scripts/compute_post_deployment.py index 00c84e1..0f47cb2 100755 --- a/deployment_scripts/compute_post_deployment.py +++ b/deployment_scripts/compute_post_deployment.py @@ -7,7 +7,7 @@ import os import re from socket import inet_ntoa from struct import pack -import subprocess # nosec +import subprocess import sys import stat import yaml @@ -47,7 +47,7 @@ def execute(*cmd, **kwargs): else: env = None logging.info(env_prefix + ' '.join(cmd)) - proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, # nosec + proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) if 'prompt' in kwargs: @@ -117,7 +117,7 @@ def get_astute(astute_path): if not os.path.exists(astute_path): reportError('%s not found' % astute_path) - astute = yaml.safe_load(open(astute_path)) + astute = yaml.load(open(astute_path)) return astute @@ -281,13 +281,13 @@ def route_to_compute(endpoints, himn_xs, himn_local, username): ip, cidr = endpoint.split('/') net, mask = _net(ip), _mask(cidr) if not _routed(net, mask, himn_local): - params = ['route', 'add', '-net', '"%s"' % net, 'netmask', - '"%s"' % mask, 'gw', himn_local] + params = ['route', 'add', '-net', net, 'netmask', + mask, 'gw', himn_local] ssh(himn_xs, username, *params) # Always add the route to the udev, even if it's currently active cmd = ( - "printf 'if !(/sbin/route -n | /bin/grep -q -F \"{net}\"); then\n" - "/sbin/route add -net \"{net}\" netmask \"{mask}\" gw {himn_local};\n" + "printf 'if !(/sbin/route -n | /bin/grep -q -F {net}); then\n" + "/sbin/route add -net {net} netmask {mask} gw {himn_local};\n" "fi\n' >> /etc/udev/scripts/reroute.sh" ) cmd = cmd.format(net=net, mask=mask, himn_local=himn_local) @@ -302,11 +302,12 @@ def route_to_compute(endpoints, himn_xs, himn_local, username): def install_suppack(himn, username): """Install xapi driver supplemental pack. """ - tmp = ssh(himn, username, 'mktemp', '-d') - scp(himn, username, tmp, XS_PLUGIN_ISO) - ssh(himn, username, 'xe-install-supplemental-pack', tmp + '/' + XS_PLUGIN_ISO, - prompt='Y\n') - ssh(himn, username, 'rm', tmp, '-rf') + # TODO(Johnhua): check if installed + scp(himn, username, '/tmp/', XS_PLUGIN_ISO) + ssh( + himn, username, 'xe-install-supplemental-pack', + '/tmp/%s' % XS_PLUGIN_ISO, prompt='Y\n') + ssh(himn, username, 'rm', '/tmp/%s' % XS_PLUGIN_ISO) def forward_from_himn(eth): diff --git a/metadata.yaml b/metadata.yaml index 6cb1a1b..1e3780f 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -3,7 +3,7 @@ name: fuel-plugin-xenserver # Human-readable name for your plugin title: XenServer Plugin # Plugin version -version: '3.90.2' +version: '3.90.1' # Description description: Enable Mirantis OpenStack to integrate with Xenserver # Required fuel version