diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-07-13 08:15:40 -0600 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-07-13 08:15:40 -0600 |
commit | 317a6f8c44efbefaeb800edafcc6fb4cb88bedea (patch) | |
tree | fa0842f287b8e8e2940347ed4c70d07fddb1d365 /snaps/domain/role.py | |
parent | e6326cd5e826d19e4dd2b096c17aff35da1757b3 (diff) |
Created domain class for roles.
Create Role domain class so keystone_utils.py functions returning
role objects will not be leaking out implementation details as each
API version can change these data structures and this should all be
handled by the SNAPS neutron utility.
JIRA: SNAPS-119
Change-Id: I6918a45c1c414ee6b104ec36e63c540d6f656e30
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/domain/role.py')
-rw-r--r-- | snaps/domain/role.py | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/snaps/domain/role.py b/snaps/domain/role.py new file mode 100644 index 0000000..565a3f2 --- /dev/null +++ b/snaps/domain/role.py @@ -0,0 +1,32 @@ +# Copyright (c) 2017 Cable Television Laboratories, Inc. ("CableLabs") +# and others. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +class Role: + """ + SNAPS domain object for Roles. Should contain attributes that + are shared amongst cloud providers + """ + def __init__(self, name, role_id): + """ + Constructor + :param name: the user's name + :param id: the user's id + """ + self.name = name + self.id = role_id + + def __eq__(self, other): + return self.name == other.name and self.id == other.id |