def patch_and_filter(dest_dir): os.chdir(dest_dir) utils.filter_file("build/landmines.py", lambda line: not "gyp_environment" in line) utils.commit("filter gyp_environment out of build/landmines.py") patch(dest_dir)
def patch_and_filter(dest_dir, relative_patches_dir): os.chdir(dest_dir) utils.filter_file("build/landmines.py", lambda line: not "gyp_environment" in line) utils.commit("filter gyp_environment out of build/landmines.py") patch(dest_dir, relative_patches_dir)
def patch(): os.chdir(utils.mojo_root_dir) utils.filter_file("build/landmines.py", lambda line: not "gyp" in line) utils.commit("filter gyp out of build/landmines.py") utils.filter_file("gpu/BUILD.gn", lambda line: not "//gpu/ipc" in line) utils.commit("filter gpu/ipc out of gpu/BUILD.gn") for p in utils.find(["*.patch"], os.path.dirname(os.path.realpath(__file__))): print "applying patch %s" % os.path.basename(p) utils.system(["git", "apply", p]) utils.commit("applied patch %s" % os.path.basename(p))
def _configureGlance(self): utils.execute( "sed -i 's/%%SERVICE_PASSWORD%%/%s/g' /etc/glance/glance-api-paste.ini" % self.admin_password) utils.execute( "sed -i 's/%%SERVICE_PASSWORD%%/%s/g' /etc/glance/glance-registry-paste.ini" % self.admin_password) utils.execute( "sed -i 's/%%SERVICE_TENANT_NAME%%/%s/g' /etc/glance/glance-api-paste.ini" % 'service') utils.execute( "sed -i 's/%%SERVICE_TENANT_NAME%%/%s/g' /etc/glance/glance-registry-paste.ini" % 'service') utils.execute( "sed -i 's/%%SERVICE_USER%%/%s/g' /etc/glance/glance-api-paste.ini" % 'glance') utils.execute( "sed -i 's/%%SERVICE_USER%%/%s/g' /etc/glance/glance-registry-paste.ini" % 'glance') utils.execute( "sed -i 's#sql_connection = sqlite:////var/lib/glance/glance.sqlite#sql_connection = %s#g' /etc/glance/glance-registry.conf" % self.glance_sql_connection) utils.execute('sed -i "/paste_deploy/d" /etc/glance/glance-registry.conf') utils.execute('echo "[paste_deploy]" >> /etc/glance/glance-registry.conf') utils.execute('sed -i "/flavor = keystone/d" /etc/glance/glance-registry.conf') utils.execute('echo "flavor = keystone" >> /etc/glance/glance-registry.conf') utils.execute('sed -i "/paste_deploy/d" /etc/glance/glance-api.conf') utils.execute('echo "[paste_deploy]" >> /etc/glance/glance-api.conf') utils.execute('sed -i "/flavor = keystone/d" /etc/glance/glance-api.conf') utils.execute('echo "flavor = keystone" >> /etc/glance/glance-api.conf') utils.execute("service glance-api stop && service glance-registry stop", check_exit_code=False) if self.glance_mount_type == 'local': utils.execute('rm -fr /var/lib/glance/images', check_exit_code=False) utils.execute('mkdir -p /var/lib/glance/images', check_exit_code=False) utils.execute('chown glance:glance -R /var/lib/glance/images') if self.glance_mount_type == 'nfs': utils.execute('mkdir -p /var/lib/glance/images', check_exit_code=False) # configure NFS mount mpoint = '%s %s nfs %s 0 0' % ( self.glance_mount_point, '/var/lib/glance/images', self.glance_mount_parameters) utils.filter_file(lambda l:mpoint not in l, '/etc/fstab') utils.execute('echo "\n%s" >> /etc/fstab' % mpoint) # mount NFS remote utils.execute('mount -a') utils.execute('chown -R glance:glance /var/lib/glance/images') utils.execute("service glance-api start && service glance-registry start") utils.execute("glance-manage version_control 0") utils.execute("glance-manage db_sync") return
def patch_and_filter(): """Applies the *.patch files in the current dir and some hardcoded filters.""" os.chdir(utils.mojo_root_dir) utils.filter_file("build/landmines.py", lambda line: not "gyp_environment" in line) utils.commit("filter gyp_environment out of build/landmines.py") utils.filter_file("gpu/BUILD.gn", lambda line: not "//gpu/ipc" in line) utils.commit("filter //gpu/ipc out of gpu/BUILD.gn") utils.filter_file("cc/BUILD.gn", lambda line: not "//media" in line) utils.commit("filter //media out of cc/BUILD.gn") patch()