Colin Copeland avatar Colin Copeland committed 2841089

fix locale-gen; switch order of virtualenv and distribute install; properly chown new authorized_keys files

Comments (0)

Files changed (1)

mallet/client_vm.py

 import logging
 from mallet.bootstrap import apt
 from mallet.bootstrap.apt import lenny
-from mallet.utils import create_ssh, call, write, writelines
+from mallet.utils import create_ssh, call, write, writelines, chown
 from mallet.bootstrap.base import PackageGroup
 
 from libcloud.types import Provider
     packages = ['postgresql', 'postgresql-server-dev-8.4']
 
     def post_install(self, node_wrapper):
-        call(['local-gen', 'en_US.UTF-8'])
+        call(['locale-gen', 'en_US.UTF-8'])
         call(['update-locale', 'LANG=en_US.UTF-8'])
         call(['pg_dropcluster', '--stop', '8.4', 'main'])
         call(['pg_createcluster', '--start', '-e', 'UTF-8', '8.4', 'main'])
 
     def post_install(self, node_wrapper):
         call(['easy_install', '-U', 'pip'])
+        call(['pip', 'install', '-U', 'virtualenv'])
         call(['pip', 'install', '-U', 'distribute'])
-        call(['pip', 'install', '-U', 'virtualenv'])
 
 
 class Apache(lenny.Apache):
             config = env.cfg.config
             if config.has_option('mallet', 'public_key'):
                 ssh_dir = os.path.join('/', 'home', name, '.ssh')
-                call(['mkdir', '-p', ssh_dir])
+                call(['sudo', '-u', name, 'mkdir -p %s' % ssh_dir])
                 public_key = open(config.get('mallet', 'public_key')).read()
                 authorized_keys = os.path.join(ssh_dir, 'authorized_keys')
                 write(authorized_keys, public_key, append=True)
+                chown(authorized_keys, name)
 
             # logger.info('Setting password for user')
             # print 'Please choose a UNIX password for the "%s" user' % name
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.