#!/usr/bin/python
import re
import shutil
f1 = open("/etc/puppet/puppet.conf", "r")
f2 = open("/tmp/puppet_tmp", "w")
pattern= 'main'
append = 'server = puppet.forthscale.com'
for line in f1.readlines():
	definition = re.findall(pattern, line)
	if definition:			
			f2.write(line +'\n' + append + '\n')
	else:
			f2.write(line)
f1.close()
f2.close()
shutil.copy2('/tmp/puppet_tmp', '/etc/puppet/puppet.conf')


5cd171b06424c2e33e5d2d549cba51fcf69e4707
<mask token>

<mask token>
for line in f1.readlines():
    definition = re.findall(pattern, line)
    if definition:
        f2.write(line + '\n' + append + '\n')
    else:
        f2.write(line)
f1.close()
f2.close()
shutil.copy2('/tmp/puppet_tmp', '/etc/puppet/puppet.conf')

<mask token>
f1 = open('/etc/puppet/puppet.conf', 'r')
f2 = open('/tmp/puppet_tmp', 'w')
pattern = 'main'
append = 'server = puppet.forthscale.com'
for line in f1.readlines():
    definition = re.findall(pattern, line)
    if definition:
        f2.write(line + '\n' + append + '\n')
    else:
        f2.write(line)
f1.close()
f2.close()
shutil.copy2('/tmp/puppet_tmp', '/etc/puppet/puppet.conf')

import re
import shutil
f1 = open('/etc/puppet/puppet.conf', 'r')
f2 = open('/tmp/puppet_tmp', 'w')
pattern = 'main'
append = 'server = puppet.forthscale.com'
for line in f1.readlines():
    definition = re.findall(pattern, line)
    if definition:
        f2.write(line + '\n' + append + '\n')
    else:
        f2.write(line)
f1.close()
f2.close()
shutil.copy2('/tmp/puppet_tmp', '/etc/puppet/puppet.conf')

#!/usr/bin/python
import re
import shutil
f1 = open("/etc/puppet/puppet.conf", "r")
f2 = open("/tmp/puppet_tmp", "w")
pattern= 'main'
append = 'server = puppet.forthscale.com'
for line in f1.readlines():
	definition = re.findall(pattern, line)
	if definition:			
			f2.write(line +'\n' + append + '\n')
	else:
			f2.write(line)
f1.close()
f2.close()
shutil.copy2('/tmp/puppet_tmp', '/etc/puppet/puppet.conf')

