Commits

Anonymous committed c0bfc30

Back to MH, but with some TBD comments

  • Participants
  • Parent commits 5a76a81

Comments (0)

Files changed (2)

File djaboto/management/commands/aws.py

             fab_api.env['unsaved'] = True
         if options.get('git_repo', False):
             fab_api.env['git_repo'] = options['git_repo']
+        else:
+            fab_api.env['git_repo'] = False
         fab_api.env['rcfile'] = options.get('fabricrc', './.aws_fabric')
 
         ###TODO: this should be yanked and replaced with a boto config file solution instead
                 self.set_awsSecurityGroups()
                 self.install_awsUbuntuUpgrades()
                 ###TODO: need to enable this as default, as soon as the function works safely
-                self.set_awsElasticIP()
+                # self.set_awsElasticIP()
                 self.sync_awsProject(push=True)
                 self.install_awsPythonRequirements(reinstall=True)
                 ###TODO: DropDB needs to use the RDS Settings
             # fab_api.env['user'] = getuser()
             # if not fab_exists('/%s/etc/ssh/id_rsa.pub' % settings.PROJECT_DIR):
                 # if not fab_exists('%s/etc/ssh' % settings.PROJECT_DIR):
-                    # fab_api.run('mkdir %s/etc/ssh' % settings.PROJECT_DIR)
+                    # fab_api.run('mkdir -p %s/etc/ssh' % settings.PROJECT_DIR)
                 # fab_api.run('ssh-keygen -f %s/etc/ssh/id_rsa -N ""' % settings.PROJECT_DIR)
 
             # keyfile = os.path.abspath(os.path.join(settings.PROJECT_DIR, "etc", "ssh", "id_rsa.pub"))
 
         instance = self.get_awsInstance()
 
-        if fab_api.env.git_repo is not None:
+        if fab_api.env.git_repo:
 
             if not fab_exists('~/.ssh/id_rsa'):
                 if not fab_exists('~/django/tmp/%s/etc/ssh' % fab_api.env.SITENAME) and not fab_exists('~/django/%s/etc/ssh/id_rsa' % fab_api.env.SITENAME):
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
                             fab_api.prefix('source ~/django/python/bin/activate'),
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
-                            fab_api.prefix('source ~/django/%s/bin/remote_data' % fab_api.env.SITENAME)):
+                            fab_api.prefix('source ~/django/%s/bin/remote_data.sh' % fab_api.env.SITENAME)):
             fab_api.run('python manage.py reset --noinput menus')
 
 
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
                             fab_api.prefix('source ~/django/python/bin/activate'),
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
-                            fab_api.prefix('source ~/django/%s/bin/remote_data' % fab_api.env.SITENAME)):
+                            fab_api.prefix('source ~/django/%s/bin/remote_data.sh' % fab_api.env.SITENAME)):
 
             # Update the database and link all media files
             fab_api.run('python manage.py syncdb --noinput --verbosity=0')
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
                             fab_api.prefix('source ~/django/python/bin/activate'),
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
-                            fab_api.prefix('source ~/django/%s/bin/remote_data' % fab_api.env.SITENAME)):
+                            fab_api.prefix('source ~/django/%s/bin/remote_data.sh' % fab_api.env.SITENAME)):
 
             # Link the media files
 
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
                             fab_api.prefix('source ~/django/python/bin/activate'),
                             fab_api.cd('~/django/%s' % fab_api.env.SITENAME),
-                            fab_api.prefix('source ~/django/%s/bin/remote_data' % fab_api.env.SITENAME)):
+                            fab_api.prefix('source ~/django/%s/bin/remote_data.sh' % fab_api.env.SITENAME)):
 
             for cmd in args[0]:
                 fab_api.run(command='python manage.py %s' % cmd)

File djaboto/management/commands/checkmix.py

     check_call(['chmod','+x','%s/manage.py' % DIR_PROJECT])
 
     ###TODO: Add segment to generate, as well as source, the local database environment variables.
-    DIR_BIN_OLD = os.path.join(DIR_PROJECT, args.site_name, 'bin')
-    print DIR_BIN_OLD
+    DIR_BIN = os.path.join(DIR_PROJECT, 'bin')
     DIR_DATACONF_NEW = os.path.join('/home', getuser(), '.soupmix', args.site_name)
     if not os.path.exists(DIR_DATACONF_NEW):
         print DIR_DATACONF_NEW
         # fab_api.run('python manage.py migrate --verbosity=0')
         fab_api.run('mkdir -p %s' % DIR_DATACONF_NEW)
-        fab_api.run('mv %s/grape_data.sh %s' % (DIR_BIN_OLD, DIR_DATACONF_NEW))
-        check_call(['mv', '%s/nymph_data.sh' % DIR_BIN_OLD, DIR_DATACONF_NEW])
+        fab_api.run('mv %s/grape_data.sh %s' % (DIR_BIN, DIR_DATACONF_NEW))
+        check_call(['mv', '%s/nymph_data.sh' % DIR_BIN, DIR_DATACONF_NEW])
     localhost_datafile = os.path.join(DIR_DATACONF_NEW, '%s_data.sh' % gethostname())
     fab_api.env.host_string = 'localhost'
     if os.path.exists(localhost_datafile):
             # Update the database and link all media files
             fab_api.run('python manage.py syncdb --noinput --verbosity=0')
             fab_api.run('python manage.py migrate --verbosity=0')
-
-        DIR_BIN_NEW = os.path.join(DIR_PROJECT, 'bin')
-        print DIR_BIN_NEW
-        check_call(['mv', DIR_BIN_OLD, DIR_BIN_NEW])
     else:
         DIR_BIN_NEW = os.path.join(DIR_PROJECT, 'bin')
         print DIR_BIN_NEW