diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-15 12:32:23 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2013-03-15 12:32:23 -0400 |
commit | cd8fd312c1463aab564a5d811ef92b1e3d938c7a (patch) | |
tree | 1c93cd2e526e31537ef9e3032bc35352c33be834 /src/lib/Bcfg2/Server/Admin/Init.py | |
parent | 7e34868c0c6bfe788deb2891a67b230e856fbdb1 (diff) | |
download | bcfg2-cd8fd312c1463aab564a5d811ef92b1e3d938c7a.tar.gz bcfg2-cd8fd312c1463aab564a5d811ef92b1e3d938c7a.tar.bz2 bcfg2-cd8fd312c1463aab564a5d811ef92b1e3d938c7a.zip |
init: fixed creation of repo directory for real this time
Diffstat (limited to 'src/lib/Bcfg2/Server/Admin/Init.py')
-rw-r--r-- | src/lib/Bcfg2/Server/Admin/Init.py | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/lib/Bcfg2/Server/Admin/Init.py b/src/lib/Bcfg2/Server/Admin/Init.py index 48fa89498..3e642ee49 100644 --- a/src/lib/Bcfg2/Server/Admin/Init.py +++ b/src/lib/Bcfg2/Server/Admin/Init.py @@ -221,7 +221,6 @@ class Init(Bcfg2.Server.Admin.Mode): if response.lower().strip() == 'y': break else: - os.makedirs(self.data['repopath']) break def _prompt_password(self): @@ -319,6 +318,16 @@ class Init(Bcfg2.Server.Admin.Mode): def init_repo(self): """Setup a new repo and create the content of the configuration file.""" + # Create the repository + path = os.path.join(self.data['repopath'], 'etc') + try: + os.makedirs(path) + self._init_plugins() + print("Repository created successfuly in %s" % + self.data['repopath']) + except OSError: + print("Failed to create %s." % path) + confdata = CONFIG % (self.data['repopath'], ','.join(self.plugins), self.data['sendmail'], @@ -334,13 +343,3 @@ class Init(Bcfg2.Server.Admin.Mode): create_key(self.data['shostname'], self.data['keypath'], self.data['certpath'], self.data['country'], self.data['state'], self.data['location']) - - # Create the repository - path = os.path.join(self.data['repopath'], 'etc') - try: - os.makedirs(path) - self._init_plugins() - print("Repository created successfuly in %s" % - self.data['repopath']) - except OSError: - print("Failed to create %s." % path) |