Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PE-14495) Remove pluginsync setting if upgrading to 1.4.x #101

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

MikaelSmith
Copy link
Contributor

No description provided.


# When upgrading to 1.4.x or later remove pluginsync
if ($package_version == undef and $old_packages) or (versioncmp($package_version, '1.4.0') >= 0) {
$removedSettings = $_removedSettings + ['pluginsync']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still want to guard this if the setting is already present.

@MikaelSmith
Copy link
Contributor Author

Updated, ready to go. /cc @highb @tphoney

@tphoney
Copy link
Contributor

tphoney commented Apr 6, 2016

+1

@tphoney tphoney closed this Apr 6, 2016
@tphoney tphoney reopened this Apr 6, 2016
@highb
Copy link
Contributor

highb commented Apr 6, 2016

Ran this thorough a 2015.3.2->2015.3.x upgrade and I'm getting:

Info: Caching catalog for f4ogqvu5lus0moc.delivery.puppetlabs.net
      Info: Applying configuration version '1459980336'
      Error: /Stage[main]/Puppet_agent::Prepare::Puppet_config/Ini_setting[/pluginsync]: Could not evaluate: no implicit conversion of nil into String
      Error: /Stage[main]/Puppet_agent::Prepare::Puppet_config/Ini_setting[master/pluginsync]: Could not evaluate: no implicit conversion of nil into String
      Error: /Stage[main]/Puppet_agent::Prepare::Puppet_config/Ini_setting[agent/pluginsync]: Could not evaluate: no implicit conversion of nil into String
      Error: /Stage[main]/Puppet_agent::Prepare::Puppet_config/Ini_setting[main/pluginsync]: Could not evaluate: no implicit conversion of nil into String
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[puppetlabs-pepackages]: Dependency Ini_setting[/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[puppetlabs-pepackages]: Dependency Ini_setting[master/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[puppetlabs-pepackages]: Dependency Ini_setting[agent/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[puppetlabs-pepackages]: Dependency Ini_setting[main/pluginsync] has failures: true
      Warning: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[puppetlabs-pepackages]: Skipping because of failed dependencies
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki]: Dependency Ini_setting[/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki]: Dependency Ini_setting[master/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki]: Dependency Ini_setting[agent/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki]: Dependency Ini_setting[main/pluginsync] has failures: true
      Warning: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki]: Skipping because of failed dependencies
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg]: Dependency Ini_setting[/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg]: Dependency Ini_setting[master/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg]: Dependency Ini_setting[agent/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg]: Dependency Ini_setting[main/pluginsync] has failures: true
      Warning: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg]: Skipping because of failed dependencies
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[master/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[agent/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[main/pluginsync] has failures: true
      Warning: /Stage[main]/Puppet_agent::Osfamily::Redhat/File[/etc/pki/rpm-gpg/RPM-GPG-KEY-puppetlabs]: Skipping because of failed dependencies
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Exec[import-RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Exec[import-RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[master/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Exec[import-RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[agent/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Exec[import-RPM-GPG-KEY-puppetlabs]: Dependency Ini_setting[main/pluginsync] has failures: true
      Warning: /Stage[main]/Puppet_agent::Osfamily::Redhat/Exec[import-RPM-GPG-KEY-puppetlabs]: Skipping because of failed dependencies
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Dependency Ini_setting[/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Dependency Ini_setting[master/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Dependency Ini_setting[agent/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Dependency Ini_setting[main/pluginsync] has failures: true
      Warning: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Skipping because of failed dependencies
      Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[master/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[agent/pluginsync] has failures: true
      Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[main/pluginsync] has failures: true
      Warning: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Skipping because of failed dependencies
      Notice: Applied catalog in 0.74 seconds

    f4ogqvu5lus0moc.delivery.puppetlabs.net (centos5-64-agent) executed in 13.33 seconds
    Exited: 4
    Beaker::Host::CommandFailure: Host 'f4ogqvu5lus0moc.delivery.puppetlabs.net' exited with 4 running:
     puppet agent -t
    Last 10 lines of output were:
        Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Dependency Ini_setting[master/pluginsync] has failures: true
        Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Dependency Ini_setting[agent/pluginsync] has failures: true
        Notice: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Dependency Ini_setting[main/pluginsync] has failures: true
        Warning: /Stage[main]/Puppet_agent::Osfamily::Redhat/Yumrepo[pc_repo]: Skipping because of failed dependencies
        Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[/pluginsync] has failures: true
        Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[master/pluginsync] has failures: true
        Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[agent/pluginsync] has failures: true
        Notice: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Dependency Ini_setting[main/pluginsync] has failures: true
        Warning: /Stage[main]/Puppet_agent::Install/Package[puppet-agent]: Skipping because of failed dependencies
        Notice: Applied catalog in 0.74 seconds

$removedSettings = $_removedSettings
}

if $removedSettings {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember, are arrays truthy in puppet now? Perhaps we need to be checking !empty and not truth?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yep. Tested with Puppet 4:

# test.pp
$array = []
if $array {
  notify {'array is true':}
}else{
  notify {'array is false':}
}
~ puppet apply test.pp
WARN: Unresolved specs during Gem::Specification.reset:
      hiera (< 4, >= 2.0)
      json_pure (>= 0)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
Notice: Compiled catalog for brandonhighmbp.corp.puppetlabs.net in environment production in 0.04 seconds
Notice: array is true
Notice: /Stage[main]/Main/Notify[array is true]/message: defined 'message' as 'array is true'
Notice: Applied catalog in 0.01 seconds

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although... the .each won't iterate over an empty array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed incorrectly there.

Update: I'm relying on [].each doing nothing. The if statement is probably not necessary now, because I make sure there's always at least an empty array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can probably remove the if. As for my comment about the .each, I'm just trying to figure out where no implicit conversion of nil into String is coming from.

@MikaelSmith MikaelSmith force-pushed the tphoney-pe-14495 branch 2 times, most recently from 56824b9 to f1a6837 Compare April 6, 2016 22:55
@MikaelSmith
Copy link
Contributor Author

Ok, made updates.

@highb
Copy link
Contributor

highb commented Apr 7, 2016

@MikaelSmith The puppet.conf dep is still causing issues:

  1) puppet_agent supported operating systems on centos-5-x86_64 valid package_versions should compile into a catalogue without dependency cycles
     Failure/Error: it { is_expected.to compile.with_all_deps }
       error during compilation: Could not retrieve dependency 'File[/etc/puppetlabs/puppet/puppet.conf]' of Ini_setting[/pluginsync]

@MikaelSmith
Copy link
Contributor Author

Oh, that's interesting.

@MikaelSmith
Copy link
Contributor Author

Apparently the file needs to be managed. Hopefully fixed by ensuring it's a file if not already managed.

@highb
Copy link
Contributor

highb commented Apr 7, 2016

👍 agent_upgrade test passed with this change.

@highb highb merged commit 953737f into puppetlabs:master Apr 7, 2016
@MikaelSmith MikaelSmith deleted the tphoney-pe-14495 branch April 7, 2016 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants