summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/src
diff options
context:
space:
mode:
authorAndrew Butcher <abutcher@afrolegs.com>2017-02-27 16:13:05 -0500
committerGitHub <noreply@github.com>2017-02-27 16:13:05 -0500
commit0550138a592bc3bf202a44ed9a3e4d575e70add3 (patch)
tree9deb78cc4e324a01706d22f72de8240e98c505dd /roles/lib_openshift/src
parent833eb4ccfed255004ba21b51bab3c022201bbc83 (diff)
parent3c44e4293825b8f3aafa80bb60599476de3be57d (diff)
downloadopenshift-0550138a592bc3bf202a44ed9a3e4d575e70add3.tar.gz
openshift-0550138a592bc3bf202a44ed9a3e4d575e70add3.tar.bz2
openshift-0550138a592bc3bf202a44ed9a3e4d575e70add3.tar.xz
openshift-0550138a592bc3bf202a44ed9a3e4d575e70add3.zip
Merge pull request #3510 from abutcher/router-upgrade
Bug 1427080: The router wasn't upgraded to current ose-haproxy-router image version
Diffstat (limited to 'roles/lib_openshift/src')
-rw-r--r--roles/lib_openshift/src/lib/base.py4
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_env.py6
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_route.py8
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_secret.py4
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_serviceaccount.py6
-rwxr-xr-xroles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py14
6 files changed, 21 insertions, 21 deletions
diff --git a/roles/lib_openshift/src/lib/base.py b/roles/lib_openshift/src/lib/base.py
index 2e822d8ef..53b9f9947 100644
--- a/roles/lib_openshift/src/lib/base.py
+++ b/roles/lib_openshift/src/lib/base.py
@@ -255,13 +255,13 @@ class OpenShiftCLI(object):
if oadm:
cmds.append('adm')
+ cmds.extend(cmd)
+
if self.all_namespaces:
cmds.extend(['--all-namespaces'])
elif self.namespace is not None and self.namespace.lower() not in ['none', 'emtpy']: # E501
cmds.extend(['-n', self.namespace])
- cmds.extend(cmd)
-
rval = {}
results = ''
err = None
diff --git a/roles/lib_openshift/src/test/unit/test_oc_env.py b/roles/lib_openshift/src/test/unit/test_oc_env.py
index dab5099c2..45a3ef1eb 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_env.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_env.py
@@ -147,7 +147,7 @@ class OCEnvTest(unittest.TestCase):
# Making sure our mocks were called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'dc', 'router', '-o', 'json'], None),
+ mock.call(['oc', 'get', 'dc', 'router', '-o', 'json', '-n', 'default'], None),
])
@mock.patch('oc_env.locate_oc_binary')
@@ -333,7 +333,7 @@ class OCEnvTest(unittest.TestCase):
# Making sure our mocks were called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'dc', 'router', '-o', 'json'], None),
+ mock.call(['oc', 'get', 'dc', 'router', '-o', 'json', '-n', 'default'], None),
])
@mock.patch('oc_env.locate_oc_binary')
@@ -448,7 +448,7 @@ class OCEnvTest(unittest.TestCase):
# Making sure our mocks were called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'dc', 'router', '-o', 'json'], None),
+ mock.call(['oc', 'get', 'dc', 'router', '-o', 'json', '-n', 'default'], None),
])
@unittest.skipIf(six.PY3, 'py2 test only')
diff --git a/roles/lib_openshift/src/test/unit/test_oc_route.py b/roles/lib_openshift/src/test/unit/test_oc_route.py
index ea94bfabd..e0f6d2f3c 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_route.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_route.py
@@ -135,7 +135,7 @@ class OCRouteTest(unittest.TestCase):
# Making sure our mock was called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'route', 'test', '-o', 'json'], None),
+ mock.call(['oc', 'get', 'route', 'test', '-o', 'json', '-n', 'default'], None),
])
@mock.patch('oc_route.locate_oc_binary')
@@ -265,9 +265,9 @@ metadata:
# Making sure our mock was called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'route', 'test', '-o', 'json'], None),
- mock.call(['oc', '-n', 'default', 'create', '-f', mock.ANY], None),
- mock.call(['oc', '-n', 'default', 'get', 'route', 'test', '-o', 'json'], None),
+ mock.call(['oc', 'get', 'route', 'test', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'create', '-f', mock.ANY, '-n', 'default'], None),
+ mock.call(['oc', 'get', 'route', 'test', '-o', 'json', '-n', 'default'], None),
])
@unittest.skipIf(six.PY3, 'py2 test only')
diff --git a/roles/lib_openshift/src/test/unit/test_oc_secret.py b/roles/lib_openshift/src/test/unit/test_oc_secret.py
index 087c62dcf..bf496769a 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_secret.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_secret.py
@@ -85,8 +85,8 @@ class OCSecretTest(unittest.TestCase):
# Making sure our mock was called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'secrets', 'testsecretname', '-o', 'json'], None),
- mock.call(['oc', '-n', 'default', 'secrets', 'new', 'testsecretname', mock.ANY], None),
+ mock.call(['oc', 'get', 'secrets', 'testsecretname', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'secrets', 'new', 'testsecretname', mock.ANY, '-n', 'default'], None),
])
mock_write.assert_has_calls([
diff --git a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py
index b02b37053..3572a6728 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount.py
@@ -111,9 +111,9 @@ class OCServiceAccountTest(unittest.TestCase):
# Making sure our mock was called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'testserviceaccountname', '-o', 'json'], None),
- mock.call(['oc', '-n', 'default', 'create', '-f', mock.ANY], None),
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'testserviceaccountname', '-o', 'json'], None),
+ mock.call(['oc', 'get', 'sa', 'testserviceaccountname', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'create', '-f', mock.ANY, '-n', 'default'], None),
+ mock.call(['oc', 'get', 'sa', 'testserviceaccountname', '-o', 'json', '-n', 'default'], None),
])
@unittest.skipIf(six.PY3, 'py2 test only')
diff --git a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
index ab8ccd18c..d78349e34 100755
--- a/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
+++ b/roles/lib_openshift/src/test/unit/test_oc_serviceaccount_secret.py
@@ -181,10 +181,10 @@ secrets:
# Making sure our mocks were called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None),
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None),
- mock.call(['oc', '-n', 'default', 'replace', '-f', mock.ANY], None),
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None)
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'replace', '-f', mock.ANY, '-n', 'default'], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None)
])
yaml_file = builder_pyyaml_file
@@ -304,9 +304,9 @@ secrets:
# Making sure our mocks were called as we expected
mock_cmd.assert_has_calls([
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None),
- mock.call(['oc', '-n', 'default', 'get', 'sa', 'builder', '-o', 'json'], None),
- mock.call(['oc', '-n', 'default', 'replace', '-f', mock.ANY], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'get', 'sa', 'builder', '-o', 'json', '-n', 'default'], None),
+ mock.call(['oc', 'replace', '-f', mock.ANY, '-n', 'default'], None),
])
yaml_file = builder_pyyaml_file