From 3faa4aac91620c3bf4efb876d0c5ce51f1d004de Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Wed, 25 Jan 2017 14:27:45 -0500 Subject: Adding banners. Small bug fix to namespace appending in base. --- roles/lib_openshift/library/oc_scale.py | 32 ++++++++++++++++++++++++++++++++ roles/lib_openshift/library/oc_secret.py | 5 ++--- roles/lib_openshift/src/sources.yml | 20 ++++++++++---------- 3 files changed, 44 insertions(+), 13 deletions(-) (limited to 'roles') diff --git a/roles/lib_openshift/library/oc_scale.py b/roles/lib_openshift/library/oc_scale.py index 4e6717ec0..7397d109c 100644 --- a/roles/lib_openshift/library/oc_scale.py +++ b/roles/lib_openshift/library/oc_scale.py @@ -24,6 +24,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +# -*- -*- -*- Begin included fragment: lib/import.py -*- -*- -*- ''' OpenShiftCLI class that wraps the oc commands in a subprocess ''' @@ -40,6 +42,10 @@ import subprocess import ruamel.yaml as yaml from ansible.module_utils.basic import AnsibleModule +# -*- -*- -*- End included fragment: lib/import.py -*- -*- -*- + +# -*- -*- -*- Begin included fragment: doc/scale -*- -*- -*- + DOCUMENTATION = ''' --- module: oc_scale @@ -107,6 +113,10 @@ EXAMPLES = ''' namespace: my-php-app replicas: 2 ''' + +# -*- -*- -*- End included fragment: doc/scale -*- -*- -*- + +# -*- -*- -*- Begin included fragment: ../../lib_utils/src/class/yedit.py -*- -*- -*- # noqa: E301,E302 @@ -671,6 +681,10 @@ class Yedit(object): 'state': "present"} return {'failed': True, 'msg': 'Unkown state passed'} + +# -*- -*- -*- End included fragment: ../../lib_utils/src/class/yedit.py -*- -*- -*- + +# -*- -*- -*- Begin included fragment: lib/base.py -*- -*- -*- # pylint: disable=too-many-lines # noqa: E301,E302,E303,T001 @@ -1191,6 +1205,10 @@ class OpenShiftCLIConfig(object): return rval +# -*- -*- -*- End included fragment: lib/base.py -*- -*- -*- + +# -*- -*- -*- Begin included fragment: lib/deploymentconfig.py -*- -*- -*- + # pylint: disable=too-many-public-methods class DeploymentConfig(Yedit): @@ -1528,6 +1546,10 @@ spec: current_reps = self.get(DeploymentConfig.replicas_path) return not current_reps == replicas +# -*- -*- -*- End included fragment: lib/deploymentconfig.py -*- -*- -*- + +# -*- -*- -*- Begin included fragment: lib/replicationcontroller.py -*- -*- -*- + # pylint: disable=too-many-public-methods class ReplicationController(DeploymentConfig): @@ -1542,6 +1564,10 @@ class ReplicationController(DeploymentConfig): ''' Constructor for ReplicationController ''' super(ReplicationController, self).__init__(content=content) +# -*- -*- -*- End included fragment: lib/replicationcontroller.py -*- -*- -*- + +# -*- -*- -*- Begin included fragment: class/oc_scale.py -*- -*- -*- + # pylint: disable=too-many-instance-attributes class OCScale(OpenShiftCLI): ''' Class to wrap the oc command line tools ''' @@ -1649,6 +1675,10 @@ class OCScale(OpenShiftCLI): return {'failed': True, 'msg': 'Unknown state passed. [{}]'.format(state)} +# -*- -*- -*- End included fragment: class/oc_scale.py -*- -*- -*- + +# -*- -*- -*- Begin included fragment: ansible/oc_scale.py -*- -*- -*- + def main(): ''' ansible oc module for scaling @@ -1675,3 +1705,5 @@ def main(): if __name__ == '__main__': main() + +# -*- -*- -*- End included fragment: ansible/oc_scale.py -*- -*- -*- diff --git a/roles/lib_openshift/library/oc_secret.py b/roles/lib_openshift/library/oc_secret.py index 21779c117..69dcb314b 100644 --- a/roles/lib_openshift/library/oc_secret.py +++ b/roles/lib_openshift/library/oc_secret.py @@ -842,12 +842,11 @@ class OpenShiftCLI(object): cmd = ['get', resource] if selector: cmd.append('--selector=%s' % selector) + elif rname: + cmd.append(rname) cmd.extend(['-o', 'json']) - if rname: - cmd.append(rname) - rval = self.openshift_cmd(cmd, output=True) # Ensure results are retuned in an array diff --git a/roles/lib_openshift/src/sources.yml b/roles/lib_openshift/src/sources.yml index 4623407bc..5afcdc55d 100644 --- a/roles/lib_openshift/src/sources.yml +++ b/roles/lib_openshift/src/sources.yml @@ -27,6 +27,16 @@ oc_route.py: - lib/route.py - class/oc_route.py - ansible/oc_route.py +oc_secret.py: +- doc/generated +- doc/license +- lib/import.py +- doc/secret +- ../../lib_utils/src/class/yedit.py +- lib/base.py +- lib/secret.py +- class/oc_secret.py +- ansible/oc_secret.py oc_scale.py: - doc/generated - doc/license @@ -47,13 +57,3 @@ oc_version.py: - lib/base.py - class/oc_version.py - ansible/oc_version.py -oc_secret.py: -- doc/generated -- doc/license -- lib/import.py -- doc/secret -- ../../lib_utils/src/class/yedit.py -- lib/base.py -- lib/secret.py -- class/oc_secret.py -- ansible/oc_secret.py -- cgit v1.2.3