Issue #3004 has been updated by Ben Hughes.

This is still present in 2.7.13, kinda obviously, but still a data point:

<pre>
[root@mundilfari:~]# puppet apply -v ~/zones.pp --trace
info: Loading facts in /var/lib/puppet/lib/facter/concat_basedir.rb
info: Applying configuration version '1336001447'
/opt/puppet/lib/puppet/type/zone.rb:185:in `<'
/opt/puppet/lib/puppet/type/zone.rb:185:in `up?'
/opt/puppet/lib/puppet/type/zone.rb:155:in `sync'
/opt/puppet/lib/puppet/transaction/resource_harness.rb:114:in `apply_parameter'
/opt/puppet/lib/puppet/transaction/resource_harness.rb:56:in `perform_changes'
/opt/puppet/lib/puppet/transaction/resource_harness.rb:133:in `evaluate'
/opt/puppet/lib/puppet/transaction.rb:49:in `apply'
/opt/puppet/lib/puppet/transaction.rb:84:in `eval_resource'
/opt/puppet/lib/puppet/transaction.rb:104:in `evaluate'
/opt/puppet/lib/puppet/util.rb:484:in `thinmark'
/opt/csw/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/opt/puppet/lib/puppet/util.rb:483:in `thinmark'
/opt/puppet/lib/puppet/transaction.rb:104:in `evaluate'
/opt/puppet/lib/puppet/transaction.rb:386:in `traverse'
/opt/puppet/lib/puppet/transaction.rb:99:in `evaluate'
/opt/puppet/lib/puppet/resource/catalog.rb:141:in `apply'
/opt/puppet/lib/puppet/configurer.rb:122:in `retrieve_and_apply_catalog'
/opt/puppet/lib/puppet/util.rb:159:in `benchmark'
/opt/csw/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/opt/puppet/lib/puppet/util.rb:158:in `benchmark'
/opt/puppet/lib/puppet/configurer.rb:121:in `retrieve_and_apply_catalog'
/opt/puppet/lib/puppet/configurer.rb:152:in `run'
/opt/puppet/lib/puppet/application/apply.rb:229:in `main'
/opt/puppet/lib/puppet/application/apply.rb:149:in `run_command'
/opt/puppet/lib/puppet/application.rb:309:in `run'
/opt/puppet/lib/puppet/application.rb:416:in `hook'
/opt/puppet/lib/puppet/application.rb:309:in `run'
/opt/puppet/lib/puppet/application.rb:407:in `exit_on_fail'
/opt/puppet/lib/puppet/application.rb:309:in `run'
/opt/puppet/lib/puppet/util/command_line.rb:69:in `execute'
/opt/puppet/bin/puppet:4
err: /Stage[main]//Zoneme[smelly]/Zone[smelly]/ensure: change from running to 
absent failed: comparison of Fixnum with nil failed
<pre>
----------------------------------------
Bug #3004: zone resource on Solaris tries to change from 'running to running' 
and fails miserably
https://projects.puppetlabs.com/issues/3004#change-61878

Author: Kaspar  Schiess
Status: Requires CLA to be signed
Priority: Normal
Assignee: 
Category: Solaris
Target version: 2.7.x
Affected Puppet version: 0.25.1
Keywords: zone
Branch: 


our recipe looks something like this: 

<pre>
  zone {
    'example': 
      ensure => running, 
      ... other stuff; 
  }
</pre>

The failure we get with this is: 

<pre>
  debug: //Node[deimos.CENSORED]/Giuz_solaris_zone[CENSORED]/Zone[CENSORED]: 
Changing ensure
  debug: //Node[deimos.CENSORED]/Giuz_solaris_zone[CENSORED]/Zone[CENSORED]: 1 
change(s)
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/type/zone.rb:186:in `<'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/type/zone.rb:186:in `up?'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/type/zone.rb:155:in `sync'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:54:in `go'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction/change.rb:72:in `forward'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:118:in `apply_changes'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `collect'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:111:in `apply_changes'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:83:in `apply'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:249:in 
`eval_children_and_apply_resource'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in `thinmark'
  /opt/csw/lib/ruby/1.8/benchmark.rb:308:in `realtime'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/util.rb:416:in `thinmark'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:248:in 
`eval_children_and_apply_resource'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:205:in `eval_resource'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:294:in `evaluate'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/util.rb:417:in `thinmark'
  /opt/csw/lib/ruby/1.8/benchmark.rb:308:in `realtime'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/util.rb:416:in `thinmark'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:293:in `evaluate'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `collect'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/transaction.rb:287:in `evaluate'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/resource/catalog.rb:142:in `apply'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/configurer.rb:152:in `run'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/util.rb:177:in `benchmark'
  /opt/csw/lib/ruby/1.8/benchmark.rb:308:in `realtime'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/util.rb:176:in `benchmark'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/configurer.rb:151:in `run'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
  /opt/csw/lib/ruby/1.8/sync.rb:230:in `synchronize'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/agent.rb:53:in `run'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/agent.rb:130:in `with_client'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/agent.rb:51:in `run'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `send'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/application.rb:226:in `run_command'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail'
  /opt/csw/lib/ruby/site_ruby/1.8/puppet/application.rb:217:in `run'
  /opt/csw/sbin/puppetd:159
  err: 
//Node[deimos.CENSORED]/Giuz_solaris_zone[CENSORED]/Zone[CENSORED]/ensure: 
change from running to running failed: comparison of Fixnum with nil failed
</pre>

This fails because 'should' is 'running' (the string), where current_value is 
:running (the ruby symbol). The same applies to virtually every other value we 
set with ensure =>, since whatever we set it to, it is returned as a string and 
the solaris provider works with symbols internally. 

Implementing something like 

<pre>
  def should 
    super.to_sym
  end
</pre>

makes it work, although I think the implementation of zone.rb should be more 
thoroughly modernized... Normally, I would file a patch, but I cannot seem to 
get rspec tests to work fully (always something failing). 

We're working around this by removing the ensure=>something line altogether and 
relying on the default of :running, but that is probably unhealthy in the long 
run.



-- 
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to