summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2010-08-11 14:00:43 +0000
committerSol Jerome <sol.jerome@gmail.com>2010-08-11 15:59:59 -0500
commit1e7074270141f16d0a22d18deb06ac25507c1276 (patch)
tree80cb06c56a23aedeccd421d98f0884ce5f64a4b8 /src
parent79fc3e6818f510750cec1e688f602172d4794568 (diff)
downloadbcfg2-1e7074270141f16d0a22d18deb06ac25507c1276.tar.gz
bcfg2-1e7074270141f16d0a22d18deb06ac25507c1276.tar.bz2
bcfg2-1e7074270141f16d0a22d18deb06ac25507c1276.zip
Init: Fix traceback from ticket #906
Signed-off-by: Sol Jerome <sol.jerome@gmail.com> git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6009 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Admin/Init.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/Server/Admin/Init.py b/src/lib/Server/Admin/Init.py
index d43f4c767..0f859a2d4 100644
--- a/src/lib/Server/Admin/Init.py
+++ b/src/lib/Server/Admin/Init.py
@@ -165,7 +165,7 @@ class Init(Bcfg2.Server.Admin.Mode):
def _prompt_hostname(self):
"""Ask for the server hostname."""
- data = raw_input("What is the server's hostname: [%s]" % socket.getfqdn())
+ data = raw_input("What is the server's hostname: [%s]: " % socket.getfqdn())
if data != '':
self.shostname = data
else:
@@ -272,6 +272,9 @@ class Init(Bcfg2.Server.Admin.Mode):
# Create the repository
path = "%s/%s" % (self.repopath, 'etc')
- os.makedirs(path)
- self._init_plugins()
- print "Repository created successfuly in %s" % (self.repopath)
+ try:
+ os.makedirs(path)
+ self._init_plugins()
+ print "Repository created successfuly in %s" % (self.repopath)
+ except OSError:
+ print("Failed to create %s." % path)