Bug #2789

puppetrun triggered runs that do not specify tags fail to apply configuration properly

Added by Mr Paxos 9 months ago. Updated 8 months ago.

Status:Closed Start:11/05/2009
Priority:Normal Due date:
Assigned to:Jesse Wolfe % Done:

0%

Category:tags
Target version:0.25.2
Affected version:0.25.1 Branch:ticket/0.25.x/2789
Keywords:puppetrun puppetrunner tags
Votes: 0

Description

When puppetd is triggered by puppetrun without —tags on the command line, the @tags@ ruby object is set to @[“”]@ which fails the code below resulting in all resources being skipped and not applied.

Here is a snippet of the debug output from puppetd during a run triggered by puppetrun:

debug: //mysql-cluster::mysql-cluster-gpl/File[mysql-cluster-gpl-ebuild]: Not tagged with 
debug: //mysql-cluster::mysql-cluster-gpl/Exec[eix-update-mysql-cluster]: Not tagged with 
debug: //mysql-cluster::mysql-cluster-gpl/Package[mysql-cluster-gpl]: Not tagged with 

Here is the offending code and patch:

--- transaction.rb      2009-11-04 20:58:35.000000000 -0700
+++ transaction-new.rb  2009-11-04 21:05:22.000000000 -0700
@@ -619,7 +619,7 @@
 
     # Is this resource tagged appropriately?
     def missing_tags?(resource)
-        return false if self.ignore_tags? or tags.empty?
+        return false if self.ignore_tags? or tags.empty? or tags == [""]
         return true unless resource.tagged?(tags)
     end

I don’t speak ruby all that well, so it is hard to tell where the fix should be applied. The patch above does fix the problem, but it might not be the proper place. Perhaps the fix should be where puppetd sets the @tags@ object when receiving a puppetrun request.

0001-Fixing-2789-puppetrun-fails-without-tag.patch (3.8 KB) Jesse Wolfe, 11/11/2009 12:53 pm

Associated revisions

Revision c1e47a43df40abd5da04bf147df17f0b53bf0868
Added by Jesse Wolfe 8 months ago

Fixing #2789 puppetrun fails without —tag

Puppet::Transaction was handling “tags” strings differently depending on whether they came in from Puppet[:tags] or another source. This was causing puppetrun’s tags to be misparsed if there was not exactly one —tag parameter.

I’ve moved the code to Util::Tagging.

History

Updated by James Turnbull 9 months ago

  • Category set to tags
  • Status changed from Unreviewed to Needs design decision
  • Assigned to set to Markus Roberts
  • Target version set to 0.25.2

Updated by Markus Roberts 9 months ago

  • Assigned to changed from Markus Roberts to Jesse Wolfe

Updated by Jesse Wolfe 9 months ago

  • Status changed from Needs design decision to Ready for Testing

Updated by Jesse Wolfe 9 months ago

Updated by Markus Roberts 8 months ago

  • Status changed from Ready for Testing to Ready for Checkin

I’m marking this ready for checkin; I had raised concerns about the memory leak issue (which became #2824) on the dev list thread for this patch but those are now being addressed separately.

Updated by James Turnbull 8 months ago

  • Status changed from Ready for Checkin to Closed

Pushed in commit:“c1e47a43df40abd5da04bf147df17f0b53bf0868” in branch 0.25.x

Also available in: Atom PDF