Add missing tox.ini and .gitreview
Change-Id: I7892d1699afe921feeb1257fda05e3a4e54a68fb
This commit is contained in:
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
.tox
|
||||||
|
*.pyc
|
||||||
|
build
|
6
.gitreview
Normal file
6
.gitreview
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[gerrit]
|
||||||
|
host=review.openstack.org
|
||||||
|
port=29418
|
||||||
|
project=openstack/charm-ironic.git
|
||||||
|
defaultbranch=master
|
||||||
|
|
@@ -10,11 +10,9 @@ from charmhelpers.core.hookenv import (
|
|||||||
relation_get,
|
relation_get,
|
||||||
relation_ids,
|
relation_ids,
|
||||||
related_units,
|
related_units,
|
||||||
unit_get,
|
|
||||||
log,
|
log,
|
||||||
INFO,
|
INFO,
|
||||||
)
|
)
|
||||||
from netaddr import IPNetwork, IPAddress
|
|
||||||
import constants
|
import constants
|
||||||
import os
|
import os
|
||||||
import netifaces
|
import netifaces
|
||||||
@@ -51,11 +49,14 @@ class GlanceSwiftBackendContext(context.OSContextGenerator):
|
|||||||
for unit in related_units(rid):
|
for unit in related_units(rid):
|
||||||
ctxt = {
|
ctxt = {
|
||||||
'glance_swift_account':
|
'glance_swift_account':
|
||||||
config('swift-account') or 'AUTH_%s' % identity_ctxt['admin_tenant_id'],
|
config('swift-account') or
|
||||||
|
'AUTH_%s' % identity_ctxt['admin_tenant_id'],
|
||||||
'glance_swift_container':
|
'glance_swift_container':
|
||||||
config('swift-container') or relation_get('swift-container', rid=rid, unit=unit),
|
config('swift-container') or
|
||||||
|
relation_get('swift-container', rid=rid, unit=unit),
|
||||||
'glance_swift_temp_url_key':
|
'glance_swift_temp_url_key':
|
||||||
config('swift-temp-url-key') or relation_get('swift-temp-url-key', rid=rid, unit=unit),
|
config('swift-temp-url-key') or
|
||||||
|
relation_get('swift-temp-url-key', rid=rid, unit=unit),
|
||||||
'glance_swift_temp_url_duration':
|
'glance_swift_temp_url_duration':
|
||||||
config('swift-temp-url-duration')
|
config('swift-temp-url-duration')
|
||||||
}
|
}
|
||||||
@@ -99,9 +100,10 @@ class NeutronContext(context.OSContextGenerator):
|
|||||||
class IronicContext(context.OSContextGenerator):
|
class IronicContext(context.OSContextGenerator):
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
uefi_pxe_bootfile_name = config('uefi-pxe-bootfile-name') or \
|
uefi_pxe_bootfile_name = \
|
||||||
'bootx64.efi'
|
config('uefi-pxe-bootfile-name') or 'bootx64.efi'
|
||||||
uefi_pxe_config_template = config('uefi-pxe-config-template') or \
|
uefi_pxe_config_template = \
|
||||||
|
config('uefi-pxe-config-template') or \
|
||||||
'$pybasedir/drivers/modules/pxe_grub_config.template'
|
'$pybasedir/drivers/modules/pxe_grub_config.template'
|
||||||
|
|
||||||
pxe_bootfile_name = config('pxe-bootfile-name')
|
pxe_bootfile_name = config('pxe-bootfile-name')
|
||||||
@@ -141,7 +143,9 @@ class IronicContext(context.OSContextGenerator):
|
|||||||
'ipxe_boot_script': ipxe_boot_script,
|
'ipxe_boot_script': ipxe_boot_script,
|
||||||
'uefi_pxe_bootfile_name': uefi_pxe_bootfile_name,
|
'uefi_pxe_bootfile_name': uefi_pxe_bootfile_name,
|
||||||
'uefi_pxe_config_template': uefi_pxe_config_template,
|
'uefi_pxe_config_template': uefi_pxe_config_template,
|
||||||
'ipa_api_url': "http://{}:{}".format(resolve_address(DEPLOY), constants.API_PORTS['ironic-api'])
|
'ipa_api_url': "http://{}:{}".format(resolve_address(DEPLOY),
|
||||||
|
constants.API_PORTS[
|
||||||
|
'ironic-api'])
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctxt
|
return ctxt
|
||||||
|
@@ -48,8 +48,7 @@ def resource_map():
|
|||||||
database=config('database'),
|
database=config('database'),
|
||||||
ssl_dir=constants.IRONIC_CONF_DIR),
|
ssl_dir=constants.IRONIC_CONF_DIR),
|
||||||
context.ImageServiceContext(),
|
context.ImageServiceContext(),
|
||||||
context.IdentityServiceContext(
|
context.IdentityServiceContext(service='ironic',
|
||||||
service='ironic',
|
|
||||||
service_user='ironic'),
|
service_user='ironic'),
|
||||||
NeutronContext(),
|
NeutronContext(),
|
||||||
context.AMQPContext(
|
context.AMQPContext(
|
||||||
|
1
test-requirements.txt
Normal file
1
test-requirements.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
flake8>=2.2.4,<=2.4.1
|
43
tox.ini
Normal file
43
tox.ini
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
# Source charm: ./tox.ini
|
||||||
|
# This file is managed centrally by release-tools and should not be modified
|
||||||
|
# within individual charm repos.
|
||||||
|
[tox]
|
||||||
|
envlist = pep8,py27
|
||||||
|
skipsdist = True
|
||||||
|
skip_missing_interpreters = True
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
PYTHONHASHSEED=0
|
||||||
|
TERM=linux
|
||||||
|
LAYER_PATH={toxinidir}/layers
|
||||||
|
INTERFACE_PATH={toxinidir}/interfaces
|
||||||
|
JUJU_REPOSITORY={toxinidir}/build
|
||||||
|
passenv = http_proxy https_proxy
|
||||||
|
install_command =
|
||||||
|
pip install {opts} {packages}
|
||||||
|
|
||||||
|
[testenv:build]
|
||||||
|
basepython = python2.7
|
||||||
|
commands =
|
||||||
|
charm-build --log-level DEBUG -o {toxinidir}/build src {posargs}
|
||||||
|
|
||||||
|
[testenv:py27]
|
||||||
|
basepython = python2.7
|
||||||
|
# Reactive source charms are Python3-only, but a py27 unit test target
|
||||||
|
# is required by OpenStack Governance. Remove this shim as soon as
|
||||||
|
# permitted. http://governance.openstack.org/reference/cti/python_cti.html
|
||||||
|
whitelist_externals = true
|
||||||
|
commands = true
|
||||||
|
|
||||||
|
[testenv:pep8]
|
||||||
|
basepython = python3.5
|
||||||
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
|
commands = flake8 {posargs} hooks
|
||||||
|
|
||||||
|
[testenv:venv]
|
||||||
|
commands = {posargs}
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
ignore = E402,E226
|
||||||
|
exclude = */charmhelpers
|
Reference in New Issue
Block a user