Jira (PUP-8442) type parameters do not honor when default is set to false

5 views
Skip to first unread message

Melissa Stone (JIRA)

unread,
Feb 8, 2018, 8:05:03 PM2/8/18
to puppe...@googlegroups.com
Melissa Stone created an issue
 
Puppet / Bug PUP-8442
type parameters do not honor when default is set to false
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2018/02/08 5:04 PM
Priority: Normal Normal
Reporter: Melissa Stone

In our puppet types, we are able to set defaults for parameters defined for each type. However, if a given parameter defaults to false, the code will take that for falsiness and not include that parameter as set, even though it should be. This originates at https://github.com/puppetlabs/puppet/blob/327b03a9e1ecdc7b925720a4eec59795f4456a56/lib/puppet/type.rb#L834, where value = parameter.default will return false and send us into the else block of that if statement, which removes our parameter from the list of parameters for our given resource.

This will likely result in some unexpected changes once we fix it.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)
Atlassian logo

Melissa Stone (JIRA)

unread,
Feb 8, 2018, 8:06:03 PM2/8/18
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sub-team: Coremunity
Team: Platform Core
Sprint: Platform Core Hopper

Melissa Stone (JIRA)

unread,
Feb 8, 2018, 8:07:03 PM2/8/18
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Acceptance Criteria: * parameter defaults of {{false}} are honored and properly set
Fix Version/s: PUP 5.5.0

Melissa Stone (JIRA)

unread,
Feb 9, 2018, 5:24:02 PM2/9/18
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Feb 9, 2018, 5:24:02 PM2/9/18
to puppe...@googlegroups.com
Melissa Stone updated an issue
Change By: Melissa Stone
Sprint: Platform Core Hopper KANBAN

Melissa Stone (JIRA)

unread,
Feb 9, 2018, 5:30:03 PM2/9/18
to puppe...@googlegroups.com
Melissa Stone commented on Bug PUP-8442
 
Re: type parameters do not honor when default is set to false

Failures:
 
  1) mount provider (integration) When initially unmounted When there is no initial fstab entry When setting ensure => mounted When setting options => 'local' should leave the system in the mounted state, with data in /etc/fstab
     Failure/Error: err(format_exception(exception, message, trace))
     Mocha::ExpectationError:
       unexpected invocation: #<Puppet::Type::Mount:0x7f8e2db7dd20>.err('Could not evaluate: Permission denied @ dir_s_mkdir - /Volumes/foo_disk')
       unsatisfied expectations:
       - expected never, invoked once: #<Puppet::Type::Mount:0x7f8e2db7dd20>.err(any_parameters)
       satisfied expectations:
       - allowed any number of times, not yet invoked: Signal.trap(any_parameters)
       - allowed any number of times, invoked 3 times: Puppet::Type::Mount::ProviderParsed.default_target(any_parameters)
       - allowed any number of times, not yet invoked: Facter.value(:fips_enabled)
       - allowed any number of times, invoked 3 times: Facter.value(:osfamily)
       - allowed any number of times, invoked once: Facter.value(:operatingsystem)
       - allowed any number of times, not yet invoked: Facter.value(:kernel)
       - allowed any number of times, not yet invoked: Facter.value(:domain)
       - allowed any number of times, not yet invoked: Facter.value(:hostname)
       - allowed any number of times, invoked once: #<AnyInstance:Puppet::FileBucket::Dipper>.backup(any_parameters)
     # ./lib/puppet/util/logging.rb:69:in `log_exception'
     # ./lib/puppet/resource/status.rb:135:in `failed_because'
     # ./lib/puppet/transaction/resource_harness.rb:28:in `rescue in evaluate'
     # ./lib/puppet/transaction/resource_harness.rb:31:in `evaluate'
     # ./lib/puppet/transaction.rb:257:in `apply'
     # ./lib/puppet/transaction.rb:277:in `eval_resource'
     # ./lib/puppet/transaction.rb:181:in `call'
     # ./lib/puppet/transaction.rb:181:in `block (2 levels) in evaluate'
     # ./lib/puppet/util.rb:517:in `block in thinmark'
     # ./lib/puppet/util.rb:516:in `thinmark'
     # ./lib/puppet/transaction.rb:181:in `block in evaluate'
     # ./lib/puppet/graph/relationship_graph.rb:121:in `traverse'
     # ./lib/puppet/transaction.rb:171:in `evaluate'
     # ./lib/puppet/resource/catalog.rb:238:in `block in apply'
     # ./lib/puppet/util/log.rb:160:in `with_destination'
     # ./lib/puppet/transaction/report.rb:144:in `as_logging_destination'
     # ./lib/puppet/resource/catalog.rb:237:in `apply'
     # ./spec/integration/provider/mount_spec.rb:83:in `run_in_catalog'
     # ./spec/integration/provider/mount_spec.rb:122:in `block (10 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
     # ------------------
     # --- Caused by: ---
     # Errno::EACCES:
     #   Permission denied @ dir_s_mkdir - /Volumes/foo_disk
     #   ./lib/puppet/provider/mount.rb:9:in `mkdir'
  2) mount provider (integration) When initially unmounted When there is no initial fstab entry When setting ensure => mounted When setting options => 'journaled' should leave the system in the mounted state, with data in /etc/fstab
     Failure/Error: err(format_exception(exception, message, trace))
     Mocha::ExpectationError:
       unexpected invocation: #<Puppet::Type::Mount:0x7f8e2dc0dc40>.err('Could not evaluate: Permission denied @ dir_s_mkdir - /Volumes/foo_disk')
       unsatisfied expectations:
       - expected never, invoked once: #<Puppet::Type::Mount:0x7f8e2dc0dc40>.err(any_parameters)
       satisfied expectations:
       - allowed any number of times, not yet invoked: Signal.trap(any_parameters)
       - allowed any number of times, invoked 3 times: Puppet::Type::Mount::ProviderParsed.default_target(any_parameters)
       - allowed any number of times, not yet invoked: Facter.value(:fips_enabled)
       - allowed any number of times, invoked 3 times: Facter.value(:osfamily)
       - allowed any number of times, invoked once: Facter.value(:operatingsystem)
       - allowed any number of times, not yet invoked: Facter.value(:kernel)
       - allowed any number of times, not yet invoked: Facter.value(:domain)
       - allowed any number of times, not yet invoked: Facter.value(:hostname)
       - allowed any number of times, invoked once: #<AnyInstance:Puppet::FileBucket::Dipper>.backup(any_parameters)
     # ./lib/puppet/util/logging.rb:69:in `log_exception'
     # ./lib/puppet/resource/status.rb:135:in `failed_because'
     # ./lib/puppet/transaction/resource_harness.rb:28:in `rescue in evaluate'
     # ./lib/puppet/transaction/resource_harness.rb:31:in `evaluate'
     # ./lib/puppet/transaction.rb:257:in `apply'
     # ./lib/puppet/transaction.rb:277:in `eval_resource'
     # ./lib/puppet/transaction.rb:181:in `call'
     # ./lib/puppet/transaction.rb:181:in `block (2 levels) in evaluate'
     # ./lib/puppet/util.rb:517:in `block in thinmark'
     # ./lib/puppet/util.rb:516:in `thinmark'
     # ./lib/puppet/transaction.rb:181:in `block in evaluate'
     # ./lib/puppet/graph/relationship_graph.rb:121:in `traverse'
     # ./lib/puppet/transaction.rb:171:in `evaluate'
     # ./lib/puppet/resource/catalog.rb:238:in `block in apply'
     # ./lib/puppet/util/log.rb:160:in `with_destination'
     # ./lib/puppet/transaction/report.rb:144:in `as_logging_destination'
     # ./lib/puppet/resource/catalog.rb:237:in `apply'
     # ./spec/integration/provider/mount_spec.rb:83:in `run_in_catalog'
     # ./spec/integration/provider/mount_spec.rb:122:in `block (10 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
     # ------------------
     # --- Caused by: ---
     # Errno::EACCES:
     #   Permission denied @ dir_s_mkdir - /Volumes/foo_disk
     #   ./lib/puppet/provider/mount.rb:9:in `mkdir'
  3) mount provider (integration) When initially unmounted When there is no initial fstab entry When setting ensure => mounted When setting options => '' should leave the system in the mounted state, with data in /etc/fstab
     Failure/Error: err(format_exception(exception, message, trace))
     Mocha::ExpectationError:
       unexpected invocation: #<Puppet::Type::Mount:0x7f8e2aa96568>.err('Could not evaluate: Permission denied @ dir_s_mkdir - /Volumes/foo_disk')
       unsatisfied expectations:
       - expected never, invoked once: #<Puppet::Type::Mount:0x7f8e2aa96568>.err(any_parameters)
       satisfied expectations:
       - allowed any number of times, not yet invoked: Signal.trap(any_parameters)
       - allowed any number of times, invoked 3 times: Puppet::Type::Mount::ProviderParsed.default_target(any_parameters)
       - allowed any number of times, not yet invoked: Facter.value(:fips_enabled)
       - allowed any number of times, invoked 3 times: Facter.value(:osfamily)
       - allowed any number of times, invoked once: Facter.value(:operatingsystem)
       - allowed any number of times, invoked once: Facter.value(:kernel)
       - allowed any number of times, not yet invoked: Facter.value(:domain)
       - allowed any number of times, not yet invoked: Facter.value(:hostname)
       - allowed any number of times, invoked once: #<AnyInstance:Puppet::FileBucket::Dipper>.backup(any_parameters)
     # ./lib/puppet/util/logging.rb:69:in `log_exception'
     # ./lib/puppet/resource/status.rb:135:in `failed_because'
     # ./lib/puppet/transaction/resource_harness.rb:28:in `rescue in evaluate'
     # ./lib/puppet/transaction/resource_harness.rb:31:in `evaluate'
     # ./lib/puppet/transaction.rb:257:in `apply'
     # ./lib/puppet/transaction.rb:277:in `eval_resource'
     # ./lib/puppet/transaction.rb:181:in `call'
     # ./lib/puppet/transaction.rb:181:in `block (2 levels) in evaluate'
     # ./lib/puppet/util.rb:517:in `block in thinmark'
     # ./lib/puppet/util.rb:516:in `thinmark'
     # ./lib/puppet/transaction.rb:181:in `block in evaluate'
     # ./lib/puppet/graph/relationship_graph.rb:121:in `traverse'
     # ./lib/puppet/transaction.rb:171:in `evaluate'
     # ./lib/puppet/resource/catalog.rb:238:in `block in apply'
     # ./lib/puppet/util/log.rb:160:in `with_destination'
     # ./lib/puppet/transaction/report.rb:144:in `as_logging_destination'
     # ./lib/puppet/resource/catalog.rb:237:in `apply'
     # ./spec/integration/provider/mount_spec.rb:83:in `run_in_catalog'
     # ./spec/integration/provider/mount_spec.rb:129:in `block (10 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
     # ------------------
     # --- Caused by: ---
     # Errno::EACCES:
     #   Permission denied @ dir_s_mkdir - /Volumes/foo_disk
     #   ./lib/puppet/provider/mount.rb:9:in `mkdir'
  4) mount provider (integration) When initially unmounted When there is an initial fstab entry When setting ensure => mounted When setting options => 'local' should leave the system in the mounted state, with data in /etc/fstab
     Failure/Error: err(format_exception(exception, message, trace))
     Mocha::ExpectationError:
       unexpected invocation: #<Puppet::Type::Mount:0x7f8e2c4e56a8>.err('Could not evaluate: Permission denied @ dir_s_mkdir - /Volumes/foo_disk')
       unsatisfied expectations:
       - expected never, invoked once: #<Puppet::Type::Mount:0x7f8e2c4e56a8>.err(any_parameters)
       satisfied expectations:
       - allowed any number of times, not yet invoked: Signal.trap(any_parameters)
       - allowed any number of times, invoked 3 times: Puppet::Type::Mount::ProviderParsed.default_target(any_parameters)
       - allowed any number of times, not yet invoked: Facter.value(:fips_enabled)
       - allowed any number of times, invoked 3 times: Facter.value(:osfamily)
       - allowed any number of times, invoked once: Facter.value(:operatingsystem)
       - allowed any number of times, not yet invoked: Facter.value(:kernel)
       - allowed any number of times, not yet invoked: Facter.value(:domain)
       - allowed any number of times, not yet invoked: Facter.value(:hostname)
       - allowed any number of times, not yet invoked: #<AnyInstance:Puppet::FileBucket::Dipper>.backup(any_parameters)
     # ./lib/puppet/util/logging.rb:69:in `log_exception'
     # ./lib/puppet/resource/status.rb:135:in `failed_because'
     # ./lib/puppet/transaction/resource_harness.rb:28:in `rescue in evaluate'
     # ./lib/puppet/transaction/resource_harness.rb:31:in `evaluate'
     # ./lib/puppet/transaction.rb:257:in `apply'
     # ./lib/puppet/transaction.rb:277:in `eval_resource'
     # ./lib/puppet/transaction.rb:181:in `call'
     # ./lib/puppet/transaction.rb:181:in `block (2 levels) in evaluate'
     # ./lib/puppet/util.rb:517:in `block in thinmark'
     # ./lib/puppet/util.rb:516:in `thinmark'
     # ./lib/puppet/transaction.rb:181:in `block in evaluate'
     # ./lib/puppet/graph/relationship_graph.rb:121:in `traverse'
     # ./lib/puppet/transaction.rb:171:in `evaluate'
     # ./lib/puppet/resource/catalog.rb:238:in `block in apply'
     # ./lib/puppet/util/log.rb:160:in `with_destination'
     # ./lib/puppet/transaction/report.rb:144:in `as_logging_destination'
     # ./lib/puppet/resource/catalog.rb:237:in `apply'
     # ./spec/integration/provider/mount_spec.rb:83:in `run_in_catalog'
     # ./spec/integration/provider/mount_spec.rb:122:in `block (10 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
     # ------------------
     # --- Caused by: ---
     # Errno::EACCES:
     #   Permission denied @ dir_s_mkdir - /Volumes/foo_disk
     #   ./lib/puppet/provider/mount.rb:9:in `mkdir'
  5) mount provider (integration) When initially unmounted When there is an initial fstab entry When setting ensure => mounted When setting options => 'journaled' should leave the system in the mounted state, with data in /etc/fstab
     Failure/Error: err(format_exception(exception, message, trace))
     Mocha::ExpectationError:
       unexpected invocation: #<Puppet::Type::Mount:0x7f8e2ab7e200>.err('Could not evaluate: Permission denied @ dir_s_mkdir - /Volumes/foo_disk')
       unsatisfied expectations:
       - expected never, invoked once: #<Puppet::Type::Mount:0x7f8e2ab7e200>.err(any_parameters)
       satisfied expectations:
       - allowed any number of times, not yet invoked: Signal.trap(any_parameters)
       - allowed any number of times, invoked 3 times: Puppet::Type::Mount::ProviderParsed.default_target(any_parameters)
       - allowed any number of times, not yet invoked: Facter.value(:fips_enabled)
       - allowed any number of times, invoked 3 times: Facter.value(:osfamily)
       - allowed any number of times, invoked once: Facter.value(:operatingsystem)
       - allowed any number of times, not yet invoked: Facter.value(:kernel)
       - allowed any number of times, not yet invoked: Facter.value(:domain)
       - allowed any number of times, not yet invoked: Facter.value(:hostname)
       - allowed any number of times, invoked once: #<AnyInstance:Puppet::FileBucket::Dipper>.backup(any_parameters)
     # ./lib/puppet/util/logging.rb:69:in `log_exception'
     # ./lib/puppet/resource/status.rb:135:in `failed_because'
     # ./lib/puppet/transaction/resource_harness.rb:28:in `rescue in evaluate'
     # ./lib/puppet/transaction/resource_harness.rb:31:in `evaluate'
     # ./lib/puppet/transaction.rb:257:in `apply'
     # ./lib/puppet/transaction.rb:277:in `eval_resource'
     # ./lib/puppet/transaction.rb:181:in `call'
     # ./lib/puppet/transaction.rb:181:in `block (2 levels) in evaluate'
     # ./lib/puppet/util.rb:517:in `block in thinmark'
     # ./lib/puppet/util.rb:516:in `thinmark'
     # ./lib/puppet/transaction.rb:181:in `block in evaluate'
     # ./lib/puppet/graph/relationship_graph.rb:121:in `traverse'
     # ./lib/puppet/transaction.rb:171:in `evaluate'
     # ./lib/puppet/resource/catalog.rb:238:in `block in apply'
     # ./lib/puppet/util/log.rb:160:in `with_destination'
     # ./lib/puppet/transaction/report.rb:144:in `as_logging_destination'
     # ./lib/puppet/resource/catalog.rb:237:in `apply'
     # ./spec/integration/provider/mount_spec.rb:83:in `run_in_catalog'
     # ./spec/integration/provider/mount_spec.rb:122:in `block (10 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
     # ------------------
     # --- Caused by: ---
     # Errno::EACCES:
     #   Permission denied @ dir_s_mkdir - /Volumes/foo_disk
     #   ./lib/puppet/provider/mount.rb:9:in `mkdir'
  6) mount provider (integration) When initially unmounted When there is an initial fstab entry When setting ensure => mounted When setting options => '' should leave the system in the mounted state, with data in /etc/fstab
     Failure/Error: err(format_exception(exception, message, trace))
     Mocha::ExpectationError:
       unexpected invocation: #<Puppet::Type::Mount:0x7f8e29cbe148>.err('Could not evaluate: Permission denied @ dir_s_mkdir - /Volumes/foo_disk')
       unsatisfied expectations:
       - expected never, invoked once: #<Puppet::Type::Mount:0x7f8e29cbe148>.err(any_parameters)
       satisfied expectations:
       - allowed any number of times, not yet invoked: Signal.trap(any_parameters)
       - allowed any number of times, invoked 3 times: Puppet::Type::Mount::ProviderParsed.default_target(any_parameters)
       - allowed any number of times, not yet invoked: Facter.value(:fips_enabled)
       - allowed any number of times, invoked 3 times: Facter.value(:osfamily)
       - allowed any number of times, invoked once: Facter.value(:operatingsystem)
       - allowed any number of times, not yet invoked: Facter.value(:kernel)
       - allowed any number of times, not yet invoked: Facter.value(:domain)
       - allowed any number of times, not yet invoked: Facter.value(:hostname)
       - allowed any number of times, not yet invoked: #<AnyInstance:Puppet::FileBucket::Dipper>.backup(any_parameters)
     # ./lib/puppet/util/logging.rb:69:in `log_exception'
     # ./lib/puppet/resource/status.rb:135:in `failed_because'
     # ./lib/puppet/transaction/resource_harness.rb:28:in `rescue in evaluate'
     # ./lib/puppet/transaction/resource_harness.rb:31:in `evaluate'
     # ./lib/puppet/transaction.rb:257:in `apply'
     # ./lib/puppet/transaction.rb:277:in `eval_resource'
     # ./lib/puppet/transaction.rb:181:in `call'
     # ./lib/puppet/transaction.rb:181:in `block (2 levels) in evaluate'
     # ./lib/puppet/util.rb:517:in `block in thinmark'
     # ./lib/puppet/util.rb:516:in `thinmark'
     # ./lib/puppet/transaction.rb:181:in `block in evaluate'
     # ./lib/puppet/graph/relationship_graph.rb:121:in `traverse'
     # ./lib/puppet/transaction.rb:171:in `evaluate'
     # ./lib/puppet/resource/catalog.rb:238:in `block in apply'
     # ./lib/puppet/util/log.rb:160:in `with_destination'
     # ./lib/puppet/transaction/report.rb:144:in `as_logging_destination'
     # ./lib/puppet/resource/catalog.rb:237:in `apply'
     # ./spec/integration/provider/mount_spec.rb:83:in `run_in_catalog'
     # ./spec/integration/provider/mount_spec.rb:129:in `block (10 levels) in <top (required)>'
     # util/rspec_runner:44:in `run'
     # util/rspec_runner:59:in `<main>'
     # ------------------
     # --- Caused by: ---
     # Errno::EACCES:
     #   Permission denied @ dir_s_mkdir - /Volumes/foo_disk
     #   ./lib/puppet/provider/mount.rb:9:in `mkdir'
Finished in 36.98 seconds (files took 5.94 seconds to load)
 
Finished in 2 minutes 46.2 seconds
24342 examples, 6 failures, 46 pending
 
Failed examples:
rspec ./spec/integration/provider/mount_spec.rb[1:1:1:3:1:1] # mount provider (integration) When initially unmounted When there is no initial fstab entry When setting ensure => mounted When setting options => 'local' should leave the system in the mounted state, with data in /etc/fstab
rspec ./spec/integration/provider/mount_spec.rb[1:1:1:3:2:1] # mount provider (integration) When initially unmounted When there is no initial fstab entry When setting ensure => mounted When setting options => 'journaled' should leave the system in the mounted state, with data in /etc/fstab
rspec ./spec/integration/provider/mount_spec.rb[1:1:1:3:4:1] # mount provider (integration) When initially unmounted When there is no initial fstab entry When setting ensure => mounted When setting options => '' should leave the system in the mounted state, with data in /etc/fstab
rspec ./spec/integration/provider/mount_spec.rb[1:1:2:3:1:1] # mount provider (integration) When initially unmounted When there is an initial fstab entry When setting ensure => mounted When setting options => 'local' should leave the system in the mounted state, with data in /etc/fstab
rspec ./spec/integration/provider/mount_spec.rb[1:1:2:3:2:1] # mount provider (integration) When initially unmounted When there is an initial fstab entry When setting ensure => mounted When setting options => 'journaled' should leave the system in the mounted state, with data in /etc/fstab
rspec ./spec/integration/provider/mount_spec.rb[1:1:2:3:4:1] # mount provider (integration) When initially unmounted When there is an initial fstab entry When setting ensure => mounted When setting options => '' should leave the system in the mounted state, with data in /etc/fstab

Eric Delaney (JIRA)

unread,
Feb 14, 2018, 1:17:03 PM2/14/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Feb 14, 2018, 2:58:04 PM2/14/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Acceptance Criteria:
* parameter defaults of {{false}} are honored and properly set

* false values are correctly stored in the last run report and corrective change transactionstore.yaml

Josh Cooper (JIRA)

unread,
Feb 15, 2018, 12:51:02 PM2/15/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Feb 15, 2018, 12:52:02 PM2/15/18
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8442
 
Re: type parameters do not honor when default is set to false

There's a related issue when setting the desired value of a property to a falsey value in PUP-2368.

Josh Cooper (JIRA)

unread,
Feb 20, 2018, 3:13:02 PM2/20/18
to puppe...@googlegroups.com

Melissa Stone (JIRA)

unread,
Feb 20, 2018, 3:21:02 PM2/20/18
to puppe...@googlegroups.com
Melissa Stone updated an issue
 
Change By: Melissa Stone
Release Notes Summary: When setting a type parameter to false, previously puppet did not honor this and would treat that parameter as not set, and so would end up being nil. This change ensures that type parameter that defaults to false is correctly set to false rather than nil.
Release Notes: Bug Fix

Josh Cooper (JIRA)

unread,
Mar 2, 2018, 2:28:05 PM3/2/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 5.5.0
Fix Version/s: PUP 6.0.0
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Mar 2, 2018, 2:39:02 PM3/2/18
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8442
 
Re: type parameters do not honor when default is set to false

We had to revert this change because the vcsrepo 1.2.0 module defines a "generic" force parameter:

  newparam :force do
    desc "Force repository creation, destroying any files on the path in the process."
    newvalues(:true, :false)
    defaultto false
  end

Older versions of puppet cause the parameter value to be set to nil, :false or :true, where nil is the default, and the latter two occur if the value is set explicitly in a manifest as "false" or "true", respectively.

With the above change, the provider's default false becomes :false, which in ruby is truthy. This causes the vcsrepo type to think force has been set to true and it will attempt to delete the local repo on each run.

The incorrect boolean handling in the vcsrepo was fixed in https://github.com/puppetlabs/puppetlabs-vcsrepo/commit/b581a255161fe7fd5d6d264b5c0274ccb852cdcd

Josh Cooper (JIRA)

unread,
Mar 2, 2018, 2:57:05 PM3/2/18
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Mar 2, 2018, 4:14:03 PM3/2/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core Hopper

Josh Cooper (JIRA)

unread,
Mar 2, 2018, 4:14:03 PM3/2/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Josh Cooper (JIRA)

unread,
Mar 19, 2018, 12:22:03 PM3/19/18
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-8442
 
Re: type parameters do not honor when default is set to false

I think we need to figure out a way to support boolean parameter/properties that doesn't break existing modules.

Craig Gomes (JIRA)

unread,
Mar 19, 2018, 5:45:04 PM3/19/18
to puppe...@googlegroups.com
Craig Gomes updated an issue
 
Change By: Craig Gomes
Sprint: Platform Core Hopper Grooming

Melissa Stone (JIRA)

unread,
Mar 20, 2018, 12:44:03 PM3/20/18
to puppe...@googlegroups.com
Melissa Stone assigned an issue to Unassigned
Change By: Melissa Stone
Assignee: Melissa Stone

Josh Cooper (JIRA)

unread,
Jul 10, 2018, 2:13:03 PM7/10/18
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core Grooming

Rob Braden (JIRA)

unread,
Jul 23, 2018, 5:05:03 PM7/23/18
to puppe...@googlegroups.com
Rob Braden updated an issue
Change By: Rob Braden
Fix Version/s: PUP 6.0.0
Fix Version/s: PUP 6.y

Michael Hashizume (Jira)

unread,
Mar 3, 2023, 6:17:02 PM3/3/23
to puppe...@googlegroups.com
Michael Hashizume updated an issue
Change By: Michael Hashizume
Team: Coremunity Phoenix
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Michael Hashizume (Jira)

unread,
Mar 3, 2023, 6:18:02 PM3/3/23
to puppe...@googlegroups.com
Michael Hashizume commented on Bug PUP-8442
 
Re: type parameters do not honor when default is set to false

Came across this ticket while doing RuboCop work (flagged by the Lint/BooleanSymbol cop), setting this ticket as "Open" and reassigning from the defunct Coremunity team to Phoenix.

Reply all
Reply to author
Forward
0 new messages