Issue #7078 has been updated by Uwe Stuehler.

As a workarond, I was able to avoid the warning by wrapping the exported 
resources in a separate definition and then switching on 
$settings::storeconfigs:

<pre>
if $::settings::storeconfigs {
  exported_resources { $name:
    ...
  }
} else {
   # use virtual resources, instead
   ...
}
</pre>

The "exported_resources" resource seems to be autoloaded only if it is actually 
needed, so the parser never sees the "@@"-declarations.

----------------------------------------
Bug #7078: resource_type search can produce errors if storedconfigs is not 
configured.
https://projects.puppetlabs.com/issues/7078#change-89182

* Author: Dan Bode
* Status: Accepted
* Priority: Normal
* Assignee: 
* Category: stored configuration
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
(NOTE: the following is run against 2.7 (currently next), I have also seen the 
same warnings in 2.6.x)

If I have a manifest which tries to export resources, then I get the following 
warning when retrieving the resource_type:

<pre>
# cat /tmp/foo.pp class foo ($bar) {
  @@notify { 'foo': } 
}

[root@mypuppetmaster motd]# puppet resource_type search '*' --manifest 
/tmp/foo.pp
warning: You cannot collect without storeconfigs being set on line 2 in file 
/tmp/foo.pp
[
  {
    "name": "foo",
    "arguments": {
      "bar": null
    },
    "line": 1,
    "type": "hostclass",
    "file": "/tmp/foo.pp"
  }
]
</pre>

This warning should not occur, since having stored configs configured is not a 
requirement for querying the type.

configuring stored configs on the server makes the errors go away

I also verified that the resource_type call is not exporting resources if 
storedconfigs is enabled.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to