DeepSea icon indicating copy to clipboard operation
DeepSea copied to clipboard

salt-run state.orch ceph.stage.2 failed by "could not determine a constructor for the tag 'tag:yaml.org,2002:python/unicode'"

Open james-li opened this issue 6 years ago • 1 comments

Description of Issue/Question

When run

salt-run state.orch ceph.stage.2 

It reports

/srv/pillar/ceph/proposals/profile-default/stack/default/ceph/minions/susestor03.yml:
could not determine a constructor for the tag 'tag:yaml.org,2002:python/unicode



Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

#cat /srv/pillar/ceph/proposals/profile-default/stack/default/ceph/minions/susestor03.yml
ceph:
  storage:
    osds:
      !!python/unicode '/dev/disk/by-id/scsi-14d53465420202020832449605b2b124896cab775ad2c6efe':
        format: bluestore

Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

Versions Report

(Provided by running: salt-run deepsea.version

# rpm -qi deepsea
Name        : deepsea
Version     : 0.7.35+git.0.b1a7f7f
Release     : 1.1
Architecture: noarch
Install Date: Tue Aug 28 05:32:32 2018
Group       : System/Libraries
Size        : 1550050
License     : GPL-3.0
Signature   : RSA/SHA256, Wed Oct 18 13:16:18 2017, Key ID 70af9e8139db7c82
Source RPM  : deepsea-0.7.35+git.0.b1a7f7f-1.1.src.rpm
Build Date  : Wed Oct 18 13:15:56 2017
Build Host  : sheep16
Relocations : (not relocatable)
Packager    : https://www.suse.com/
Vendor      : SUSE LLC <https://www.suse.com/>
URL         : https://github.com/suse/deepsea
Summary     : Salt solution for deploying and managing Ceph
Description :
A collection of Salt files providing a deployment of Ceph as a series of stages.
Distribution: SUSE Linux Enterprise 12

rpm -qi salt-minion

# rpm -qi salt-minion
Name        : salt-minion
Version     : 2018.3.0
Release     : 46.33.1
Architecture: x86_64
Install Date: Mon Aug 27 07:26:23 2018
Group       : System/Management
Size        : 39745
License     : Apache-2.0
Signature   : RSA/SHA256, Wed Aug  1 12:36:48 2018, Key ID 70af9e8139db7c82
Source RPM  : salt-2018.3.0-46.33.1.src.rpm
Build Date  : Wed Aug  1 12:34:00 2018
Build Host  : sheep93
Relocations : (not relocatable)
Packager    : https://www.suse.com/
Vendor      : SUSE LLC <https://www.suse.com/>
URL         : http://saltstack.org/
Summary     : The client component for Saltstack
Description :
Salt minion is queried and controlled from the master.
Listens to the salt master and execute the commands.
Distribution: SUSE Linux Enterprise 12

rpm -qi salt-master

# rpm -qi salt-master
Name        : salt-master
Version     : 2018.3.0
Release     : 46.33.1
Architecture: x86_64
Install Date: Mon Aug 27 07:26:07 2018
Group       : System/Management
Size        : 2331410
License     : Apache-2.0
Signature   : RSA/SHA256, Wed Aug  1 12:36:48 2018, Key ID 70af9e8139db7c82
Source RPM  : salt-2018.3.0-46.33.1.src.rpm
Build Date  : Wed Aug  1 12:34:00 2018
Build Host  : sheep93
Relocations : (not relocatable)
Packager    : https://www.suse.com/
Vendor      : SUSE LLC <https://www.suse.com/>
URL         : http://saltstack.org/
Summary     : The management component of Saltstack with zmq protocol supported
Description :
The Salt master is the central server to which all minions connect.
Enabled commands to remote systems to be called in parallel rather
than serially.
Distribution: SUSE Linux Enterprise 12

)

james-li avatar Aug 29 '18 03:08 james-li

patch, just FYI

diff --git a/srv/modules/runners/push.py b/srv/modules/runners/push.py
index d58daba2..eadf4d4e 100644
--- a/srv/modules/runners/push.py
+++ b/srv/modules/runners/push.py
@@ -162,6 +162,8 @@ class PillarData(object):
         # Keep yaml human readable/editable
         self.friendly_dumper = yaml.SafeDumper
         self.friendly_dumper.ignore_aliases = lambda self, data: True
+        yaml.SafeLoader.add_constructor("tag:yaml.org,2002:python/unicode", lambda loader, node: node.value)
+
 
     def output(self, common):
         """

james-li avatar Aug 29 '18 04:08 james-li