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

Virt cleanup #48262

Merged
merged 8 commits into from Jun 22, 2018
Merged

Virt cleanup #48262

merged 8 commits into from Jun 22, 2018

Conversation

@cbosdo
Copy link
Collaborator

@cbosdo cbosdo commented Jun 22, 2018

What does this PR do?

Cleans up the virt module documentation, removes some deprecated or unused functions and merge all is_*_hyper() functions into more flexible get_hypervisor()

What issues does this PR fix or reference?

None

Tests written?

No, no feature changes in this PR, at most a new function grouping 2 others.

Commits signed with GPG?

Yes

cbosdo added 8 commits Jun 22, 2018
Fix pylint in virt module and its tests
This is fix errors like the following when building docs:

WARNING: autodoc: failed to import module 'salt.states.saltmod'; the following exception was raised:
Traceback (most recent call last):
  File "/public/src/salt/env/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
    __import__(modname)
  File "/public/src/salt/salt/states/saltmod.py", line 36, in <module>
    import salt.output
  File "/public/src/salt/salt/output/__init__.py", line 19, in <module>
    import salt.loader
  File "/public/src/salt/salt/loader.py", line 23, in <module>
    import salt.config
  File "/public/src/salt/salt/config/__init__.py", line 27, in <module>
    import salt.utils.network
  File "/public/src/salt/salt/utils/network.py", line 35, in <module>
    import salt.utils.zeromq
  File "/public/src/salt/salt/utils/zeromq.py", line 39, in <module>
    if tornado.version_info < (5,):
TypeError: '<' not supported between instances of 'Mock' and 'tuple'
Mockup _load_json_file() in order to avoid the following errors when
building the docs:

WARNING: autodoc: failed to import module 'salt.modules.boto_asg'; the following exception was raised:
Traceback (most recent call last):
  File "/public/src/salt/env/lib/python3.6/site-packages/sphinx/ext/autodoc/importer.py", line 140, in import_module
    __import__(modname)
  File "/public/src/salt/salt/modules/boto_asg.py", line 63, in <module>
    import boto.ec2
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/ec2/__init__.py", line 31, in <module>
    RegionData = load_regions().get('ec2', {})
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/regioninfo.py", line 100, in load_regions
    endpoints = _load_builtin_endpoints()
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/regioninfo.py", line 128, in _load_builtin_endpoints
    resolver = BotoEndpointResolver(endpoints)
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/endpoints.py", line 150, in __init__
    endpoint_data, service_rename_map)
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/endpoints.py", line 44, in __init__
    super(_CompatEndpointResolver, self).__init__(endpoint_data)
  File "/public/src/salt/env/lib/python3.6/site-packages/boto/vendored/regions/regions.py", line 95, in __init__
    raise ValueError('Missing "partitions" in endpoint data')
ValueError: Missing "partitions" in endpoint data
Several fixes have been squashed into this commit to make the virt
module documentation correct:

 * add missing parameters documentation in publicly exposed functions
 * fix ..versionadded into .. versionadded
 * a few minor display glitches
Fix typos in tests docstrings
The _get_image_info() function was deprecated but still in use by
_gen_vol_xml(). Refactor to use __disk_profile() data instead.
Unused code needs to go away.
Since the number of detected hypervisors can only grow, merge all
is_*_hyper functions into a single get_hypervisor one.
@cbosdo cbosdo mentioned this pull request Jun 22, 2018
@cbosdo
Copy link
Collaborator Author

@cbosdo cbosdo commented Jun 22, 2018

@rallytime, @gtmanfred could you have a look at this PR? I think it should be a rather straight-forward one.

@rallytime rallytime requested review from gtmanfred and rallytime Jun 22, 2018
@rallytime rallytime merged commit 2661ae5 into saltstack:develop Jun 22, 2018
5 of 10 checks passed
@cbosdo cbosdo deleted the virt-cleanup branch Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants