This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
augtool> set /files/etc/puppet/puppet.conf/test/sq ' | |
error: Failed to execute command | |
unmatched ' | |
augtool> set /files/etc/puppet/puppet.conf/test/sq_sq ''' | |
error: Failed to execute command | |
unmatched ' | |
augtool> set /files/etc/puppet/puppet.conf/test/sq_dq "'" | |
augtool> set /files/etc/puppet/puppet.conf/test/sqsq '' | |
augtool> set /files/etc/puppet/puppet.conf/test/sqsq_sq '''' | |
augtool> set /files/etc/puppet/puppet.conf/test/sqsq_dq "''" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 900a053a994a26129f3412e35ba39657cfab8c2c Mon Sep 17 00:00:00 2001 | |
From: Dominic Cleal <dcleal@redhat.com> | |
Date: Thu, 1 Mar 2012 08:31:44 +0000 | |
Subject: [PATCH] (#11988) Work around Augeas reload bug when changing save | |
modes | |
After saving a file in one save mode and switching to another, Augeas realise | |
to reload the file when Augeas#load is called again. Work around this by | |
explicitly reloading all files we saved while using the first save mode. | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ -d etc/ssh ] || mkdir -p etc/ssh | |
echo "PermitRootLogin no" > etc/ssh/sshd_config | |
cat <<EOF | augtool -er . | |
set /augeas/save newfile | |
get /augeas/version | |
print /augeas/files/etc/ssh/sshd_config | |
set /files/etc/ssh/sshd_config/PermitRootLogin yes | |
save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Check that saving preserves mode and ownership; for this test to make | |
# much sense (if any) the user running it should have at least one | |
# supplementary group | |
run_augtool() { | |
savemode=$1 | |
augtool --nostdinc -r $root -I $abs_top_srcdir/lenses <<EOF | |
set /augeas/save $savemode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it "should handle clearm commands" do | |
@resource[:changes] = ["set test[1]/Jar/Jar Foo","set test[2]/Jar/Jar Bar","clearm test Jar/Jar"] | |
@resource[:context] = "/foo/" | |
@augeas.expects(:respond_to?).with("clearm").returns(true) | |
@augeas.expects(:set).with("/foo/test[1]/Jar/Jar", "Foo").returns(true) | |
@augeas.expects(:set).with("/foo/test[2]/Jar/Jar", "Bar").returns(true) | |
@augeas.expects(:clearm).with("/foo/test", "Jar/Jar").returns(true) | |
@augeas.expects(:save).returns(true) | |
@augeas.expects(:close) | |
@provider.execute_changes.should == :executed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if before or after | |
# Insert before or after given path | |
aug.insert(before or after, "path", before ? true : false) | |
entry_path = "#{fpath}/path[count(*)=0]" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Puppet.features.add(:json, :libs => ["json"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/spec/unit/transaction/resource_harness_spec.rb b/spec/unit/transaction/resource_harness_spec.rb | |
index 7e9aac4..6334d77 100755 | |
--- a/spec/unit/transaction/resource_harness_spec.rb | |
+++ b/spec/unit/transaction/resource_harness_spec.rb | |
@@ -111,17 +111,25 @@ describe Puppet::Transaction::ResourceHarness do | |
describe "when an error occurs" do | |
before :each do | |
stub_provider = make_stub_provider | |
- resource = stub_provider.new :name => 'name', :foo => 1, :bar => 2 | |
- resource.expects(:err).never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class sodefaultserver { | |
include resolv_conf | |
resolv_conf{ 'resolv.conf' : | |
domainname=> 'abc.com', | |
searchpath=> 'abc.com', | |
nameservers => ['10.87.42.109', '10.87.42.110'], | |
options => ['timeout:2', 'attempts:3'], | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 0e00d961d5e3fbd874eb542c9b346e7223b18d00 | |
Author: Dominic Cleal <dcleal@redhat.com> | |
Date: Fri Feb 8 10:48:33 2013 +0000 | |
Would have message gone | |
diff --git a/lib/puppet/transaction/event_manager.rb b/lib/puppet/transaction/event_manager.rb | |
index ac46376..e232f37 100644 | |
--- a/lib/puppet/transaction/event_manager.rb | |
+++ b/lib/puppet/transaction/event_manager.rb |