From db6eadd6c39ec03aba728dc446adf938fae96e5e Mon Sep 17 00:00:00 2001 From: Super-User Date: Wed, 26 Apr 2017 23:30:53 +0200 Subject: [PATCH] update oxygen release notes for grains deprecation --- doc/topics/releases/oxygen.rst | 8 ++++++++ salt/grains/mdata.py | 2 ++ 2 files changed, 10 insertions(+) diff --git a/doc/topics/releases/oxygen.rst b/doc/topics/releases/oxygen.rst index 9963d4d29d..eb99259042 100644 --- a/doc/topics/releases/oxygen.rst +++ b/doc/topics/releases/oxygen.rst @@ -62,3 +62,11 @@ The ``cmd`` state had the following changes: The ``file`` state had the following changes: - The ``show_diff`` option was removed. Please use ``show_changes`` instead. + +Grain Deprecations +------------------ + +For ``smartos`` some grains have been deprecated. These grains will be removed in Neon. + +- The ``hypervisor_uuid`` has been replaced with ``mdata:sdc:server_uuid`` grain. +- The ``datacenter`` has been replaced with ``mdata:sdc:datacenter_name`` grain. diff --git a/salt/grains/mdata.py b/salt/grains/mdata.py index c82f30a9c4..59093db333 100644 --- a/salt/grains/mdata.py +++ b/salt/grains/mdata.py @@ -128,6 +128,7 @@ def _sdc_mdata(mdata_list=None, mdata_get=None): 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']: @@ -158,6 +159,7 @@ 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