Displaying 2 results from an estimated 2 matches for "constructorerror".
2011 Oct 12
4
Python yaml help
...Platform
kernelmajversion: "2.6"
My code:
class PuppetFacts(yaml.YAMLObject):
yaml_tag = u''!ruby/object:Puppet::Node::Facts''
def __init__(self, name, values):
self.name = name
self.values = values
The attempt to load the doc results in:
ConstructorError: could not determine a constructor for the tag
''!ruby/object:Puppet::Node::Facts''
in "<byte string>", line 1, column 5
Thanks a lot,
Mohamed.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post...
2010 Sep 28
13
Reading Puppet reports with Python
...;'!ruby/object:Puppet::Transaction::Report''
def __init__(self, host, logs, metrics, records, time):
self.host = host
self.logs = logs
self.metrics = metrics
self.records = records
self.time = time
However, the Python YAML parser fails with:
"yaml.constructor.ConstructorError: expected a mapping node, but found
scalar"
On the ruby/sym line:
!ruby/sym config_retrieval: 0.853000164031982
I don''t know how to define the classes to accept a scalar data type rather
than a mapping node data type, and Mr Google is giving me ZERO answers.
Doug.
--
You rece...