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

Add deprecation warning path for glance state and execution module #55592

Merged
merged 2 commits into from
Dec 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion salt/modules/glance.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _auth(profile=None, api_version=2, **connection_args):
Only intended to be used within glance-enabled modules
'''
__utils__['versions.warn_until'](
Copy link
Collaborator

@s0undt3ch s0undt3ch Dec 12, 2019

Choose a reason for hiding this comment

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

I know this is not your change but why are we preferring __utils__ instead of the direct function call?
You know the reason behind that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Personally I thought we always preferred __utils__ where possible since its packed in via the loader instead of importing directly. Is there a reason not to?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Guess there really isn't a reason, I apparently just dislike it's usage, seems like mixing loader stuff with regular utils modules, but it's just my personal preference.

'Neon',
'Aluminium',
(
'The glance module has been deprecated and will be removed in {version}. '
'Please update to using the glanceng module'
Expand Down
7 changes: 7 additions & 0 deletions salt/states/glance.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ def image_present(name, visibility='public', protected=None,
- disk_format ('raw' (default), 'vhd', 'vhdx', 'vmdk', 'vdi', 'iso',
'qcow2', 'aki', 'ari' or 'ami')
'''
__utils__['versions.warn_until'](
'Aluminium',
(
'The glance state module has been deprecated and will be removed in {version}. '
'Please update to using the glance_image state module'
),
)
ret = {'name': name,
'changes': {},
'result': True,
Expand Down
2 changes: 1 addition & 1 deletion salt/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ class SaltStackVersion(object):
'Neon' : (MAX_SIZE - 99, 0),
'Sodium' : (MAX_SIZE - 98, 0),
'Magnesium' : (MAX_SIZE - 97, 0),
'Aluminium' : (MAX_SIZE - 96, 0),
# pylint: disable=E8265
#'Aluminium' : (MAX_SIZE - 96, 0),
#'Silicon' : (MAX_SIZE - 95, 0),
#'Phosphorus' : (MAX_SIZE - 94, 0),
#'Sulfur' : (MAX_SIZE - 93, 0),
Expand Down