Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added namespace command group #878

Merged
merged 1 commit into from
Feb 2, 2021
Merged

Added namespace command group #878

merged 1 commit into from
Feb 2, 2021

Conversation

andy-maier
Copy link
Contributor

@andy-maier andy-maier commented Jan 22, 2021

Ready for review and test.

Now uses pywbem from master again.

@andy-maier andy-maier changed the title Added namespace command group [WIP] Added namespace command group Jan 22, 2021
@andy-maier andy-maier self-assigned this Jan 22, 2021
@andy-maier andy-maier added this to the 0.9.0 milestone Jan 22, 2021
@andy-maier andy-maier linked an issue Jan 22, 2021 that may be closed by this pull request
@andy-maier andy-maier force-pushed the andy/add-namespace branch 2 times, most recently from 2a1358e to ffdf06f Compare January 23, 2021 15:30
@andy-maier andy-maier changed the title [WIP] Added namespace command group Added namespace command group Jan 23, 2021
@andy-maier andy-maier force-pushed the andy/add-namespace branch 7 times, most recently from 8aa061e to b48579c Compare January 23, 2021 20:12
@coveralls
Copy link

coveralls commented Jan 23, 2021

Coverage Status

Coverage increased (+0.1%) to 92.597% when pulling 09c782b on andy/add-namespace into 83582f1 on master.

@KSchopmeyer
Copy link
Contributor

KSchopmeyer commented Jan 26, 2021

I think this one is OK. Tested as far as I could against OpenPegasus. I want to run another test against pegasus in a docker image since there I can test create and delete of namespaces. Will try to do that tonight.

Note that most of the existing test scripts now fail any namespace command and return the Model error because they do not have an interop namespace but that is a separate issue.

I make some minor comments.

Copy link
Contributor

@KSchopmeyer KSchopmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am generally comfortable with this one after playing with it and reviewing. Made some editorial comments and marked test needed since I would like to run create/delete test against OpenPegasus in a container.

@KSchopmeyer
Copy link
Contributor

KSchopmeyer commented Jan 28, 2021

Tested a variety of the commands against docker image of OpenPegasus with no problems including creating, populating the namespace and deleting the namespace.

COMMENTS on testing against new namespace commands.
Where we found a whole in our command set is in deleting the namespace with data in it.

  1. Can delete the classes but it is one by one. Note that the --force option works so it is simply a case of deleting each class with the --force option.
  2. Cannot delete the qualifier declarations. There is no command to do that (only qualifier get and enumerate exist).
  3. Since we cannot delete the qualifiers from pywbemcli we can never delete the namespace if qualifiers were ever inserted into it.
  4. To put mof into the namespace one must go outside of pywbemcli and use mof_compiler to compile the mof into the namespace. That works.

DISCUSSION: We should consider the following:

  1. Add --force to the namespace delete. This allows the user to create and delete namespaces and the --force is consistent with the class delete.
  2. Consider a qualifier delete if we are going to be complete.

HOWEVER, This are for future discussion and the code passed the review and tests that it is built for today.

@andy-maier
Copy link
Contributor Author

On the discussion items:

@andy-maier
Copy link
Contributor Author

At this point, there is only the comment open on explaining the use of CIM object terms without the "CIM" term.

Details:

* Added a 'namespace' command group that allows liting, creating and deleting
  CIM namespaces, and showing the Interop namespace. The 'server namespaces'
  and 'server interop' commands that provide a subset of that functionality
  have been deprecated. (issue #877)

* Deprecated the 'server namespaces' and 'server interop' commands. Use the
  new commands 'namespace list' and 'namespace interop', respectively.
  (issue #877)

* Added a MOF file simple_interop_mock_model.mof that sets up the Interop
  namespace with a minimal model for namespace creation and deletion via
  pywbem.WBEMServer.create_namespace() and delete_namespace() (i.e. just the
  CIM_Namespace and CIM_ObjectManager classes), and a user namespace with
  the simple mock model.

* Added a mock script simple_interop_mock_script.py that loads the
  simple_interop_mock_model.mof model and registers the pywbem-provided
  namespace provider. It can be used as a standalone mock file that
  creates a minimal but functioning Interop namespace that allows
  operating on namespaces.

* Added unit testcases in test_namespace_cmds.py that use either the
  simple interop model when verifying that namespace operations can work,
  or the simple (non-interop) model for verifying that the missing interop
  namespace causes the commands to fail.

Signed-off-by: Andreas Maier <[email protected]>
@andy-maier andy-maier merged commit 8a0050e into master Feb 2, 2021
@andy-maier andy-maier deleted the andy/add-namespace branch February 2, 2021 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for namespace commands
3 participants