From 171bd68cac5d19ba6178e9288a85ef122e6fbd1a Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 17 Mar 2017 16:03:49 -0400 Subject: Adding oc_group to lib_openshift --- roles/lib_openshift/src/lib/group.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 roles/lib_openshift/src/lib/group.py (limited to 'roles/lib_openshift/src/lib') diff --git a/roles/lib_openshift/src/lib/group.py b/roles/lib_openshift/src/lib/group.py new file mode 100644 index 000000000..fac5fcbc2 --- /dev/null +++ b/roles/lib_openshift/src/lib/group.py @@ -0,0 +1,36 @@ +# pylint: skip-file +# flake8: noqa + + +class GroupConfig(object): + ''' Handle route options ''' + # pylint: disable=too-many-arguments + def __init__(self, + sname, + namespace, + kubeconfig): + ''' constructor for handling group options ''' + self.kubeconfig = kubeconfig + self.name = sname + self.namespace = namespace + self.data = {} + + self.create_dict() + + def create_dict(self): + ''' return a service as a dict ''' + self.data['apiVersion'] = 'v1' + self.data['kind'] = 'Group' + self.data['metadata'] = {} + self.data['metadata']['name'] = self.name + self.data['users'] = None + + +# pylint: disable=too-many-instance-attributes +class Group(Yedit): + ''' Class to wrap the oc command line tools ''' + kind = 'group' + + def __init__(self, content): + '''Group constructor''' + super(Group, self).__init__(content=content) -- cgit v1.2.3