diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-03-27 09:52:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-27 09:52:47 -0500 |
commit | f0cdf051ef01978269482a72ae074b822daeea3b (patch) | |
tree | 82c5c5585442b03577259b671a1381b499d634b1 /roles/lib_openshift/src/lib | |
parent | f1db80c12f9271099bf65cb69ad0e2804764b7ef (diff) | |
parent | 21646621634bb43eb899b0b178c97d280801f89e (diff) | |
download | openshift-f0cdf051ef01978269482a72ae074b822daeea3b.tar.gz openshift-f0cdf051ef01978269482a72ae074b822daeea3b.tar.bz2 openshift-f0cdf051ef01978269482a72ae074b822daeea3b.tar.xz openshift-f0cdf051ef01978269482a72ae074b822daeea3b.zip |
Merge pull request #3345 from joelddiaz/oc_user
Merged by openshift-bot
Diffstat (limited to 'roles/lib_openshift/src/lib')
-rw-r--r-- | roles/lib_openshift/src/lib/user.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/lib/user.py b/roles/lib_openshift/src/lib/user.py new file mode 100644 index 000000000..a14d5fc91 --- /dev/null +++ b/roles/lib_openshift/src/lib/user.py @@ -0,0 +1,37 @@ +# pylint: skip-file +# flake8: noqa + + +class UserConfig(object): + ''' Handle user options ''' + def __init__(self, + kubeconfig, + username, + full_name): + ''' constructor for handling user options ''' + self.kubeconfig = kubeconfig + self.username = username + self.full_name = full_name + + self.data = {} + self.create_dict() + + def create_dict(self): + ''' return a user as a dict ''' + self.data['apiVersion'] = 'v1' + self.data['fullName'] = self.full_name + self.data['groups'] = None + self.data['identities'] = None + self.data['kind'] = 'User' + self.data['metadata'] = {} + self.data['metadata']['name'] = self.username + + +# pylint: disable=too-many-instance-attributes +class User(Yedit): + ''' Class to wrap the oc command line tools ''' + kind = 'user' + + def __init__(self, content): + '''User constructor''' + super(User, self).__init__(content=content) |