A library containing standardized trait strings. Used by placement service and clients to ensure consistency.
Go to file
Chris Dent 789ce955ea Correctly recurse os_traits packages
When walk_packages is called, unless a prefix is provided, it is
easy to escape the os_traits package and start walking other
packages. If there is a top-level 'tests' package somewhere in the
python path, this can then lead to importing all sorts of things,
some which rely on the environment having certain characteristics
and fail the import without that, some which will change the
environment.

Neither of these things are good. Nor do we want to be walking
packages all over the place. By providing a prefix we stay within
the os_traits package as desired.

Change-Id: Icde41191e39317ff5a031fff9ece0f05f1e0b4bc
Closes-Bug: #1694792
2017-05-31 19:04:05 +00:00
doc/source Rename the rest capabilities to traits 2016-09-20 05:40:55 +00:00
os_traits Correctly recurse os_traits packages 2017-05-31 19:04:05 +00:00
releasenotes Rename the rest capabilities to traits 2016-09-20 05:40:55 +00:00
.gitignore Fix testing with tox 2016-10-08 08:07:58 +00:00
.gitreview update pep8/hacking and address failures 2017-03-02 11:37:02 -05:00
.testr.conf Fix testing with tox 2016-10-08 08:07:58 +00:00
AUTHORS Initial commit of os-capabilities library 2016-08-03 19:25:39 -04:00
CONTRIBUTING.rst Rename the rest capabilities to traits 2016-09-20 05:40:55 +00:00
ChangeLog Initial commit of os-capabilities library 2016-08-03 19:25:39 -04:00
HACKING.rst Rename the rest capabilities to traits 2016-09-20 05:40:55 +00:00
LICENSE Initial commit of os-capabilities library 2016-08-03 19:25:39 -04:00
MANIFEST.in Initial commit of os-capabilities library 2016-08-03 19:25:39 -04:00
README.rst remove redundant get_symbol_names() func 2017-05-04 19:47:02 -04:00
babel.cfg Initial commit of os-capabilities library 2016-08-03 19:25:39 -04:00
requirements.txt Updated from global requirements 2017-03-03 22:57:04 +00:00
setup.cfg Rename capabilities to traits 2016-09-19 11:00:31 -04:00
setup.py Updated from global requirements 2017-03-03 22:57:04 +00:00
test-requirements.txt Build_sphinx always failed. 2017-05-19 01:39:07 +01:00
tox.ini update pep8/hacking and address failures 2017-03-02 11:37:02 -05:00

README.rst

os-traits

A library containing standardized trait strings.

Traits are strings that represent a feature of some resource provider. This library contains the catalog of constants that have been standardized in the OpenStack community to refer to a particular hardware, virtualization, storage, network, or device trait.

Usage

os-traits is primarily composed of a set of constants that may be referenced by simply importing the os_traits module and referencing one of the module's traits constants:

$ python
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os_traits as ot
>>> print ot.HW_CPU_X86_SSE42
HW_CPU_X86_SSE42

You can get a list of the os_traits symbols by simply doing a dir(os_traits).

Want to see the trait strings for a subset of traits? There's a method for that too:

>>> pprint.pprint(ot.get_traits(ot.NAMESPACES['X86']))
['HW_CPU_X86_AES-NI',
 'HW_CPU_X86_AVX512ER',
 'HW_CPU_X86_AVX512CD',
 'HW_CPU_X86_TBM',
 'HW_CPU_X86_TSX',
 'HW_CPU_X86_FMA3',
 'HW_CPU_X86_SVM',
 'HW_CPU_X86_FMA4',
 'HW_CPU_X86_MPX',
 'HW_CPU_X86_SSE2',
 'HW_CPU_X86_SSE3',
 'HW_CPU_X86_MMX',
 'HW_CPU_X86_SSSE3',
 'HW_CPU_X86_SSE4A',
 'HW_CPU_X86_AVX2',
 'HW_CPU_X86_SGX',
 'HW_CPU_X86_AVX',
 'HW_CPU_X86_AVX512BW',
 'HW_CPU_X86_AVX512DQ',
 'HW_CPU_X86_SSE',
 'HW_CPU_X86_SHA',
 'HW_CPU_X86_AVX512F',
 'HW_CPU_X86_F16C',
 'HW_CPU_X86_SSE41',
 'HW_CPU_X86_SSE42',
 'HW_CPU_X86_VMX',
 'HW_CPU_X86_ASF',
 'HW_CPU_X86_BMI2',
 'HW_CPU_X86_CLMUL',
 'HW_CPU_X86_AVX512VL',
 'HW_CPU_X86_AVX512PF',
 'HW_CPU_X86_XOP',
 'HW_CPU_X86_BMI',
 'HW_CPU_X86_ABM',
 'HW_CPU_X86_3DNOW']