From 76e8a8b08df5d4d8b59127abb3d0ebdc96cbf57a Mon Sep 17 00:00:00 2001 From: Josh Ellithorpe Date: Mon, 11 Jan 2016 17:18:41 -0800 Subject: [PATCH] Fix issues with Python3 and bring up a dev cluster --- cluster/aws/util.sh | 2 +- cluster/centos/util.sh | 2 +- cluster/common.sh | 2 +- cluster/gce/configure-vm.sh | 4 ++-- cluster/gce/trusty/configure.sh | 2 +- cluster/saltbase/salt/kube-addons/kube-addons.sh | 2 +- hack/parallel-e2e.sh | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index b34f1bacd4..5fb27ab59e 100755 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -117,7 +117,7 @@ function get_igw_id { function get_elbs_in_vpc { # ELB doesn't seem to be on the same platform as the rest of AWS; doesn't support filtering aws elb --output json describe-load-balancers | \ - python -c "import json,sys; lst = [str(lb['LoadBalancerName']) for lb in json.load(sys.stdin)['LoadBalancerDescriptions'] if lb['VPCId'] == '$1']; print '\n'.join(lst)" + python -c "import json,sys; lst = [str(lb['LoadBalancerName']) for lb in json.load(sys.stdin)['LoadBalancerDescriptions'] if lb['VPCId'] == '$1']; print('\n'.join(lst))" } function get_instanceid_from_name { diff --git a/cluster/centos/util.sh b/cluster/centos/util.sh index 71517f1129..1ae9feff62 100755 --- a/cluster/centos/util.sh +++ b/cluster/centos/util.sh @@ -297,6 +297,6 @@ function get-password { if [[ -z "${KUBE_USER}" || -z "${KUBE_PASSWORD}" ]]; then KUBE_USER=admin KUBE_PASSWORD=$(python -c 'import string,random; \ - print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))') + print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16)))') fi } diff --git a/cluster/common.sh b/cluster/common.sh index 39a62965e0..0e5c771784 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -170,7 +170,7 @@ function get-kubeconfig-basicauth() { # KUBE_PASSWORD function gen-kube-basicauth() { KUBE_USER=admin - KUBE_PASSWORD=$(python -c 'import string,random; print "".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16))') + KUBE_PASSWORD=$(python -c 'import string,random; print("".join(random.SystemRandom().choice(string.ascii_letters + string.digits) for _ in range(16)))') } # Get the bearer token for the current-context in kubeconfig if one exists. diff --git a/cluster/gce/configure-vm.sh b/cluster/gce/configure-vm.sh index 61b7b0a10b..ab68a5ff18 100755 --- a/cluster/gce/configure-vm.sh +++ b/cluster/gce/configure-vm.sh @@ -81,8 +81,8 @@ function set-kube-env() { import pipes,sys,yaml for k,v in yaml.load(sys.stdin).iteritems(): - print """readonly {var}={value}""".format(var = k, value = pipes.quote(str(v))) - print """export {var}""".format(var = k) + print("""readonly {var}={value}""".format(var = k, value = pipes.quote(str(v)))) + print("""export {var}""".format(var = k)) ' < """${kube_env_yaml}""")" } diff --git a/cluster/gce/trusty/configure.sh b/cluster/gce/trusty/configure.sh index 146333c4e5..a2471169b8 100644 --- a/cluster/gce/trusty/configure.sh +++ b/cluster/gce/trusty/configure.sh @@ -61,7 +61,7 @@ download_kube_env() { eval $(python -c ''' import pipes,sys,yaml for k,v in yaml.load(sys.stdin).iteritems(): - print "readonly {var}={value}".format(var = k, value = pipes.quote(str(v))) + print("readonly {var}={value}".format(var = k, value = pipes.quote(str(v)))) ''' < /tmp/kube-env-yaml > /etc/kube-env) } diff --git a/cluster/saltbase/salt/kube-addons/kube-addons.sh b/cluster/saltbase/salt/kube-addons/kube-addons.sh index b8ccdbe47a..d158d3340d 100644 --- a/cluster/saltbase/salt/kube-addons/kube-addons.sh +++ b/cluster/saltbase/salt/kube-addons/kube-addons.sh @@ -175,7 +175,7 @@ if [ ! -e "${kubelet_kubeconfig_file}" ]; then import pipes,sys,yaml for k,v in yaml.load(sys.stdin).iteritems(): - print "readonly {var}={value}".format(var = k, value = pipes.quote(str(v))) + print("readonly {var}={value}".format(var = k, value = pipes.quote(str(v)))) ''' < "${kube_env_yaml}") fi diff --git a/hack/parallel-e2e.sh b/hack/parallel-e2e.sh index ea0084e513..1d03a50893 100755 --- a/hack/parallel-e2e.sh +++ b/hack/parallel-e2e.sh @@ -80,9 +80,9 @@ failed = False for testcase in parse(sys.stdin).getElementsByTagName("testcase"): if len(testcase.getElementsByTagName("failure")) != 0: failed = True - print " FAIL: {test}".format(test = testcase.getAttribute("name")) + print(" FAIL: {test}".format(test = testcase.getAttribute("name"))) if not failed: - print " SUCCESS!" + print(" SUCCESS!") ' }