-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made local WBEM URIs compliant to DSP0207.
Details: * DSP0207 requires that there is always a leading slash in local WBEM URIs (even when namespace is not set) and always a colon before the class name (even when namespace is not set). The str() functions of CIMInstanceName and CIMClassName so far omitted that slash for local WBEM URIs, and omitted the colon for local WBEM URIs that had no namespace set. This was fixed by putting the code into new public methods to_wbem_uri() where the generation of the leading slash can be controlled via a parameter. The str() functions now use to_wbem_uri() with the parameter set so that a leading slash is now generated for local WBEM URIs; and that the colon is now always generated. This fixes the non-compliance with DSP0207. The internal function get_cimobject_header() which determines the value of the CIMObject header field needs the WBEM URI without a leading slash (it is always local) case, and calls to_wbem_uri() with the parameter set accordingly. * Improved the way real values in keybindings are generated in WBEM URIs, so that the shortest decimal representation is used that does not change the binary value (only for Python 2.7 and 3.1 and higher). * Added testcases for the new to_wbem_uri() methods, also covering the testing of the two __str__() methods. Removed the old testcases for the two __str__() methods, because they were not very exhaustive. * Adjusted a testcase in CIMInstanceToMOF.test_all() to accomodate for the now compliant WBEM URI returned by CIMInstanceName.str() which is also used in CIMInstanceName.tomof(). Signed-off-by: Andreas Maier <maiera@de.ibm.com>
- Loading branch information
1 parent
dde65ee
commit 1fbc58f
Showing
4 changed files
with
831 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.