Skip to content

Instantly share code, notes, and snippets.

@asasfu
Created November 20, 2015 16:26
Show Gist options
  • Save asasfu/64a86a50485656b0b61f to your computer and use it in GitHub Desktop.
Save asasfu/64a86a50485656b0b61f to your computer and use it in GitHub Desktop.
Fix for augeasproviders_pam
def in_position?
unless resource[:position].nil?
path, before = self.class.position_path(resource[:position], resource[:type])
mpath = "#{resource_path}[preceding-sibling::#{path}]"
augopen do |aug|
augmatch = aug.match(mpath).empty?
augmatch = before == 'before' ? augmatch : !augmatch
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment