diff --git a/os_traits/owner/__init__.py b/os_traits/owner/__init__.py new file mode 100644 index 0000000..b36bc7d --- /dev/null +++ b/os_traits/owner/__init__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +# 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. + +TRAITS = [ + # The resource provider owner is Cyborg. + 'CYBORG', + # The resource provider owner is Nova. + 'NOVA' +] diff --git a/os_traits/tests/test_os_traits.py b/os_traits/tests/test_os_traits.py index da12dc5..a8b4400 100644 --- a/os_traits/tests/test_os_traits.py +++ b/os_traits/tests/test_os_traits.py @@ -124,3 +124,9 @@ class TestSymbols(base.TestCase): for test_value, expected in values: result = ot.normalize_name(test_value) self.assertEqual(expected, result) + + +def test_owner_trait(self): + # Test for owner prefix traits. + traits = ot.get_traits('OWNER') + self.assertEqual(["OWNER_CYBORG", "OWNER_NOVA"], traits) diff --git a/releasenotes/notes/add-owner-trait-f33e0e038961cbbd.yaml b/releasenotes/notes/add-owner-trait-f33e0e038961cbbd.yaml new file mode 100644 index 0000000..71b5580 --- /dev/null +++ b/releasenotes/notes/add-owner-trait-f33e0e038961cbbd.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add owner trait of ``OWNER_NOVA`` and ``OWNER_CYBORG`` for resource + providers in order to solve the shared resource class(such as ``VGPU``) + problem by each service recording that they created.