summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Zullinger <tmz@pobox.com>2008-11-25 17:02:16 -0500
committerTodd Zullinger <tmz@pobox.com>2008-11-25 17:39:54 -0500
commit36c97db66dbf937b3fe412121c82ad5b082832c1 (patch)
treef105483a64de1008593a85610a3e453131558924
parente1de241f356a87ff8ca99aafba99f5bbcd5d5323 (diff)
downloadpuppet-host-package-36c97db66dbf937b3fe412121c82ad5b082832c1.tar.gz
puppet-host-package-36c97db66dbf937b3fe412121c82ad5b082832c1.tar.xz
puppet-host-package-36c97db66dbf937b3fe412121c82ad5b082832c1.zip
Use "host" instead of "client" in object names and comments
-rwxr-xr-xpuppet-host-package12
-rw-r--r--puppethost.py8
-rw-r--r--template.spec2
3 files changed, 10 insertions, 12 deletions
diff --git a/puppet-host-package b/puppet-host-package
index 1914dc3..101b64c 100755
--- a/puppet-host-package
+++ b/puppet-host-package
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-"""Create a host package for bootstrapping a puppet client."""
+"""Create a host package for bootstrapping a puppet host."""
import os
import glob
@@ -64,17 +64,15 @@ if not os.path.isfile(opts.template):
raise SystemExit('Template file (%s) does not exist' % opts.template)
for hostname in args:
- client = puppethost.PuppetHost(hostname, opts.__dict__)
+ host = puppethost.PuppetHost(hostname, opts.__dict__)
- cert = client.files['cert']
-
- if not os.path.exists(cert) or opts.force_cert:
- try: client.gencert()
+ if not os.path.exists(host.files['cert']) or opts.force_cert:
+ try: host.gencert()
except puppethost.PuppetHostError, error:
print error
continue
- try: client.package()
+ try: host.package()
except Exception, error:
print error
continue
diff --git a/puppethost.py b/puppethost.py
index 46be2c0..50fe5ec 100644
--- a/puppethost.py
+++ b/puppethost.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-"""Create a host package for bootstrapping a puppet client."""
+"""Create a host package for bootstrapping a puppet host."""
import os
import glob
@@ -36,7 +36,7 @@ class PuppetHostError(StandardError):
class PuppetHost(object):
def __init__(self, hostname = '', opts = defaults):
- """Puppet client class"""
+ """Puppet host class"""
if not hostname:
raise PuppetHostError('A hostname must be provided')
@@ -81,7 +81,7 @@ class PuppetHost(object):
self._check_files()
if not dir:
- dir = tempfile.mkdtemp('', 'puppet-client-')
+ dir = tempfile.mkdtemp('', 'puppet-host-')
name = 'puppet-%s-%s' % (self.hostname, self.version)
tarball = '%s/%s.tar.gz' % (dir, name)
@@ -100,7 +100,7 @@ class PuppetHost(object):
def rpm(self):
"""Create a .rpm package"""
rpmdir = self.opts['rpmdir']
- tmpdir = tempfile.mkdtemp('', 'puppet-client-')
+ tmpdir = tempfile.mkdtemp('', 'puppet-host-')
if not self.tarfile or not os.path.exists(self.tarfile):
try: self.tar(tmpdir)
diff --git a/template.spec b/template.spec
index 85b10dd..479972f 100644
--- a/template.spec
+++ b/template.spec
@@ -50,4 +50,4 @@ rm -rf %{buildroot}
%changelog
* Thu Nov 20 2008 Todd Zullinger <tmz@pobox.com>
-- Initial template for puppet client package
+- Initial template for puppet host package