Some pep8/pylint fixups.

Change-Id: I01de5ca643c5fcb918d2115b6b9d7dc039238e40
This commit is contained in:
Joshua Harlow 2013-06-13 23:27:36 -07:00 committed by Joshua Harlow
parent 3c4a0b4592
commit 43362b220c
8 changed files with 36 additions and 25 deletions

View File

@ -33,6 +33,7 @@ CONFIGS = [API_CONF, REG_CONF, API_PASTE_CONF,
LOG = logging.getLogger(__name__)
class GlanceConfigurator(base.Configurator):
# This db will be dropped and created
@ -47,6 +48,7 @@ class GlanceConfigurator(base.Configurator):
LOGGING_CONF: self._config_adjust_logging}
self.source_configs = {LOGGING_CONF: 'logging.cnf.sample'}
self.config_dir = sh.joinpths(self.installer.get_option('app_dir'), 'etc')
self.img_dir = "/var/lib/glance/images"
def _config_adjust_paste(self, config):
for (k, v) in self._fetch_keystone_params().items():
@ -65,8 +67,16 @@ class GlanceConfigurator(base.Configurator):
gparams = ghelper.get_shared_params(**self.installer.options)
config.add('bind_port', gparams['endpoints']['public']['port'])
def clean_image_storage(img_store_dir):
LOG.debug(("Ensuring file system store directory %r exists and is "
"empty."), img_store_dir)
if sh.isdir(img_store_dir):
sh.deldir(img_store_dir)
sh.mkdirslist(img_store_dir, tracewriter=self.installer.tracewriter)
config.add('default_store', 'file')
config.add('filesystem_store_datadir', "/var/lib/glance/images")
config.add('filesystem_store_datadir', self.img_dir)
clean_image_storage(self.img_dir)
def _config_adjust_reg(self, config):
self._config_adjust_api_reg(config)
@ -83,7 +93,6 @@ class GlanceConfigurator(base.Configurator):
'auth_host': params['endpoints']['admin']['host'],
'auth_port': params['endpoints']['admin']['port'],
'auth_protocol': params['endpoints']['admin']['protocol'],
'auth_uri': params['endpoints']['public']['uri'],
'admin_tenant_name': params['service_tenant'],
'admin_user': params['service_user'],

View File

@ -35,6 +35,7 @@ PKI_FILES = {
'certfile': 'ssl/certs/signing_cert.pem',
}
class KeystoneConfigurator(base.Configurator):
# This db will be dropped then created

View File

@ -80,6 +80,7 @@ CORE_PLUGIN_CLASSES = {
"quantum.plugins.linuxbridge.lb_quantum_plugin.LinuxBridgePluginV2",
}
class QuantumConfigurator(base.Configurator):
# This db will be dropped and created

View File

@ -194,4 +194,3 @@ class NetworkCleaner(object):
def clean(self):
self._stop_dnsmasq()
self._clean_iptables()

View File

@ -13,6 +13,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Package formats and package management systems support.
Supported formats:
@ -22,4 +23,4 @@ Supported formats:
Supported systems:
- pip
- YUM
"""
"""

View File

@ -31,6 +31,23 @@ from anvil import utils
LOG = logging.getLogger(__name__)
OPENSTACK_PACKAGES = set([
"cinder",
"glance",
"horizon",
"keystone",
"nova",
"oslo.config",
"quantum",
"swift",
"python-cinderclient",
"python-glanceclient",
"python-keystoneclient",
"python-novaclient",
"python-quantumclient",
"python-swiftclient",
])
class InstallHelper(object):
"""Run pre and post install for a single package.
@ -51,24 +68,6 @@ class InstallHelper(object):
utils.execute_template(*cmds, params=params)
OPENSTACK_PACKAGES = set([
"cinder",
"glance",
"horizon",
"keystone",
"nova",
"oslo.config",
"quantum",
"swift",
"python-cinderclient",
"python-glanceclient",
"python-keystoneclient",
"python-novaclient",
"python-quantumclient",
"python-swiftclient",
])
class DependencyHandler(object):
"""Basic class for handler of OpenStack dependencies.
"""
@ -102,7 +101,7 @@ class DependencyHandler(object):
@property
def python_names(self):
if self._python_names is None:
self._python_names = self._get_python_names(self.package_dirs)
self._python_names = self._get_python_names(self.package_dirs)
return self._python_names
@staticmethod

View File

@ -241,7 +241,7 @@ class YumDependencyHandler(base.DependencyHandler):
continue
# See if pip tried to download it but we already can satisfy
# it via yum and avoid building it in the first place...
(version, repo) = self._find_yum_match(yum_map, req, rpm_name)
(_version, repo) = self._find_yum_match(yum_map, req, rpm_name)
if not repo:
filtered_files.append(filename)
else:

View File

@ -37,7 +37,8 @@ function find_code {
function run_pep8 {
echo "+ Running pep8 ..."
files=$(find_code)
ignores="E202,E501,E128,E127,E126,E125,E124,E123,E121"
# See: http://pep8.readthedocs.org/en/latest/intro.html#error-codes
ignores="E121,E123,E124,E125,E126,E127,E128,E202,E501"
output_filename="pep8.log"
opts="--ignore=$ignores --repeat"
pep8 ${opts} ${files} 2>&1 > $output_filename