Fix gnocchi upgrade states when running on client node

In case when state is running on node where only client is defined,
cfg may not have enabled flag and gnocchi-upgrade shouldn't be run.

Change-Id: I7d8ad66a24224938b79326637784a430cdd98fd0
Related-Prod: https://mirantis.jira.com/browse/PROD-21937
diff --git a/gnocchi/upgrade/render_config.sls b/gnocchi/upgrade/render_config.sls
index ad7b4eb..965bdb4 100644
--- a/gnocchi/upgrade/render_config.sls
+++ b/gnocchi/upgrade/render_config.sls
@@ -4,7 +4,7 @@
   test.show_notification:
     - text: "Running gnocchi.upgrade.render_config"
 
-{%- if cfg.enabled %}
+{%- if cfg.get('enabled', false) %}
 /etc/gnocchi/gnocchi.conf:
   file.managed:
   - source: salt://gnocchi/files/{{ upgrade.new_release }}/gnocchi.conf
diff --git a/gnocchi/upgrade/upgrade/init.sls b/gnocchi/upgrade/upgrade/init.sls
index 0427c2d..3622c2a 100644
--- a/gnocchi/upgrade/upgrade/init.sls
+++ b/gnocchi/upgrade/upgrade/init.sls
@@ -1,8 +1,10 @@
-{%- from "gnocchi/map.jinja" import server with context %}
+{%- from "gnocchi/map.jinja" import cfg with context %}
 
 include:
  - gnocchi.upgrade.service_stopped
  - gnocchi.upgrade.pkgs_latest
  - gnocchi.upgrade.render_config
+{%- if cfg.get('enabled', False) %}
  - gnocchi.backend.upgrade
+{%- endif %}
  - gnocchi.upgrade.service_running