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

Deprecate smartos mdata grains #55609

Merged
merged 5 commits into from
Dec 14, 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ Versions are `MAJOR.PATCH`.
- [#54943](https://github.com/saltstack/salt/pull/54943) - RAET transport method has been removed per the deprecation schedule - [@s0undt3ch](https://github.com/s0undt3ch)

### Deprecated

- [#55609](https://github.com/saltstack/salt/pull/55609) - Remove smartos grains `hypervisor_uuid` and `datacenter` in favor of `mdata:sdc:server_uuid` and `mdata:sdc:datacenter_name`.
- [#55539](https://github.com/saltstack/salt/pull/55539) - Deprecate salt.auth.Authorize class and the any_auth method


### Changed

- [SEP 14](https://github.com/saltstack/salt-enhancement-proposals/pull/20) - Changed to numeric versions.
Expand Down
9 changes: 9 additions & 0 deletions doc/topics/releases/neon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,17 @@ Returner Removal
to Slack, the :py:func:`slack <salt.returners.slack_returner>` returner may be a suitable
replacement.

Grain Deprecations
------------------

For ``smartos`` some grains have been deprecated. These grains have been removed.

- The ``hypervisor_uuid`` has been replaced with ``mdata:sdc:server_uuid`` grain.
- The ``datacenter`` has been replaced with ``mdata:sdc:datacenter_name`` grain.

salt.auth.Authorize Class Removal
---------------------------------
- The salt.auth.Authorize Class inside of the `salt/auth/__init__.py` file has been removed and
the `any_auth` method inside of the file `salt/utils/minions.py`. These method and classes were
not being used inside of the salt code base.

26 changes: 0 additions & 26 deletions salt/grains/mdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,6 @@ def _sdc_mdata(mdata_list=None, mdata_get=None):
return grains


def _legacy_grains(grains):
'''
Grains for backwards compatibility
Remove this function in Neon
'''
# parse legacy sdc grains
if 'mdata' in grains and 'sdc' in grains['mdata']:
if 'server_uuid' not in grains['mdata']['sdc'] or 'FAILURE' in grains['mdata']['sdc']['server_uuid']:
grains['hypervisor_uuid'] = 'unknown'
else:
grains['hypervisor_uuid'] = grains['mdata']['sdc']['server_uuid']

if 'datacenter_name' not in grains['mdata']['sdc'] or 'FAILURE' in grains['mdata']['sdc']['datacenter_name']:
grains['datacenter'] = 'unknown'
else:
grains['datacenter'] = grains['mdata']['sdc']['datacenter_name']

# parse rules grains
if 'mdata' in grains and 'rules' in grains['mdata']:
grains['roles'] = grains['mdata']['roles'].split(',')

return grains


def mdata():
'''
Provide grains from the SmartOS metadata
Expand All @@ -159,8 +135,6 @@ def mdata():

grains = salt.utils.dictupdate.update(grains, _user_mdata(mdata_list, mdata_get), merge_lists=True)
grains = salt.utils.dictupdate.update(grains, _sdc_mdata(mdata_list, mdata_get), merge_lists=True)
## remove _legacy_grains in Neon
grains = _legacy_grains(grains)

return grains

Expand Down