Andrew Bogott has submitted this change and it was merged. Change subject: Explicitly handle projectgid for production ......................................................................
Explicitly handle projectgid for production Thanks to pluginsync, we now have the projectgid fact running on production. That was throwing warnings into the puppet log; this change allows the fact to run gracefully in absence of a project. Change-Id: Iea4d0a68a1a042331609cf898b7d003713edfa88 --- M modules/base/lib/facter/projectgid.rb 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Andrew Bogott: Looks good to me, approved jenkins-bot: Verified diff --git a/modules/base/lib/facter/projectgid.rb b/modules/base/lib/facter/projectgid.rb index 47ba558..7068644 100644 --- a/modules/base/lib/facter/projectgid.rb +++ b/modules/base/lib/facter/projectgid.rb @@ -8,6 +8,11 @@ Facter.add(:project_gid) do setcode do project_name = Facter::Util::Resolution.exec("egrep -A1 '^cluster {' /etc/ganglia/gmond.conf | awk -F '\"' '/name =/ {print $2}'").chomp - Facter::Util::Resolution.exec("getent group project-#{project_name} | cut -d : -f 3").chomp + gid = Facter::Util::Resolution.exec("getent group project-#{project_name} | cut -d : -f 3") + if gid + gid.chomp + else + "none" + end end end -- To view, visit https://gerrit.wikimedia.org/r/83556 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea4d0a68a1a042331609cf898b7d003713edfa88 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Andrew Bogott <abog...@wikimedia.org> Gerrit-Reviewer: Andrew Bogott <abog...@wikimedia.org> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits