From 99528c2de710ac4211875cdb214313f822a9f4e9 Mon Sep 17 00:00:00 2001 From: Evgeniy L Date: Tue, 15 Dec 2015 12:44:53 +0300 Subject: [PATCH] Rename fuel_agent into bareon Change-Id: I5c0552db35595b726c35ab5dab626cc326ef759f Closes-bug: #1524269 --- README.md | 16 +-- {fuel_agent => bareon}/__init__.py | 0 {fuel_agent => bareon}/cmd/__init__.py | 0 {fuel_agent => bareon}/cmd/agent.py | 10 +- {fuel_agent => bareon}/cmd/ironic_callback.py | 2 +- {fuel_agent => bareon}/drivers/__init__.py | 0 {fuel_agent => bareon}/drivers/base.py | 0 {fuel_agent => bareon}/drivers/bootstrap.py | 4 +- .../drivers/ks_spaces_validator.py | 4 +- {fuel_agent => bareon}/drivers/nailgun.py | 20 +-- {fuel_agent => bareon}/drivers/simple.py | 6 +- {fuel_agent => bareon}/errors.py | 0 {fuel_agent => bareon}/hooks.py | 0 {fuel_agent => bareon}/manager.py | 32 ++--- bareon/objects/__init__.py | 73 +++++++++++ {fuel_agent => bareon}/objects/base.py | 0 {fuel_agent => bareon}/objects/bootloader.py | 0 {fuel_agent => bareon}/objects/configdrive.py | 2 +- {fuel_agent => bareon}/objects/device.py | 2 +- {fuel_agent => bareon}/objects/image.py | 2 +- .../objects/operating_system.py | 0 .../objects/partition/__init__.py | 0 .../objects/partition/fs.py | 2 +- .../objects/partition/lv.py | 2 +- .../objects/partition/md.py | 4 +- .../objects/partition/parted.py | 4 +- .../objects/partition/pv.py | 2 +- .../objects/partition/scheme.py | 16 +-- .../objects/partition/vg.py | 2 +- {fuel_agent => bareon}/objects/repo.py | 0 {fuel_agent => bareon}/openstack/__init__.py | 0 .../openstack/common/__init__.py | 0 .../openstack/common/config/__init__.py | 0 .../openstack/common/config/generator.py | 12 +- .../openstack/common/gettextutils.py | 8 +- .../openstack/common/importutils.py | 2 +- .../openstack/common/local.py | 0 .../openstack/common/log.py | 8 +- .../openstack/common/processutils.py | 4 +- .../openstack/common/strutils.py | 2 +- .../openstack/common/timeutils.py | 0 {fuel_agent => bareon}/tests/__init__.py | 0 {fuel_agent => bareon}/tests/base.py | 0 .../tests/fixtures/simple_nailgun_driver.json | 0 .../tests/test_artifact_utils.py | 6 +- .../tests/test_build_utils.py | 68 +++++----- .../tests/test_configdrive.py | 4 +- {fuel_agent => bareon}/tests/test_fs_utils.py | 6 +- .../tests/test_grub_utils.py | 90 +++++++------- .../tests/test_hardware_utils.py | 8 +- {fuel_agent => bareon}/tests/test_image.py | 4 +- .../tests/test_ks_spaces_validator.py | 4 +- .../tests/test_lvm_utils.py | 6 +- {fuel_agent => bareon}/tests/test_manager.py | 116 +++++++++--------- {fuel_agent => bareon}/tests/test_md_utils.py | 10 +- {fuel_agent => bareon}/tests/test_nailgun.py | 14 +-- .../tests/test_nailgun_build_image.py | 30 ++--- .../tests/test_partition.py | 4 +- .../tests/test_partition_utils.py | 6 +- .../tests/test_requirements.py | 2 +- .../tests/test_simple_nailgun_driver.py | 6 +- {fuel_agent => bareon}/tests/test_utils.py | 32 ++--- {fuel_agent => bareon}/utils/__init__.py | 0 {fuel_agent => bareon}/utils/artifact.py | 6 +- {fuel_agent => bareon}/utils/build.py | 18 +-- {fuel_agent => bareon}/utils/decorators.py | 0 {fuel_agent => bareon}/utils/fs.py | 6 +- {fuel_agent => bareon}/utils/grub.py | 6 +- {fuel_agent => bareon}/utils/hardware.py | 12 +- {fuel_agent => bareon}/utils/lvm.py | 8 +- {fuel_agent => bareon}/utils/md.py | 8 +- {fuel_agent => bareon}/utils/partition.py | 6 +- {fuel_agent => bareon}/utils/utils.py | 10 +- {fuel_agent => bareon}/version.py | 2 +- .../fuel_bootstrap/utils/bootstrap_image.py | 2 +- .../bareon.conf.sample} | 16 +-- fuel_agent/objects/__init__.py | 73 ----------- openstack-common.conf | 2 +- setup.cfg | 40 +++--- tools/config/check_uptodate.sh | 2 +- tools/config/generate_sample.sh | 2 +- tox.ini | 8 +- 82 files changed, 442 insertions(+), 442 deletions(-) rename {fuel_agent => bareon}/__init__.py (100%) rename {fuel_agent => bareon}/cmd/__init__.py (100%) rename {fuel_agent => bareon}/cmd/agent.py (91%) rename {fuel_agent => bareon}/cmd/ironic_callback.py (98%) rename {fuel_agent => bareon}/drivers/__init__.py (100%) rename {fuel_agent => bareon}/drivers/base.py (100%) rename {fuel_agent => bareon}/drivers/bootstrap.py (92%) rename {fuel_agent => bareon}/drivers/ks_spaces_validator.py (98%) rename {fuel_agent => bareon}/drivers/nailgun.py (98%) rename {fuel_agent => bareon}/drivers/simple.py (93%) rename {fuel_agent => bareon}/errors.py (100%) rename {fuel_agent => bareon}/hooks.py (100%) rename {fuel_agent => bareon}/manager.py (98%) create mode 100644 bareon/objects/__init__.py rename {fuel_agent => bareon}/objects/base.py (100%) rename {fuel_agent => bareon}/objects/bootloader.py (100%) rename {fuel_agent => bareon}/objects/configdrive.py (99%) rename {fuel_agent => bareon}/objects/device.py (96%) rename {fuel_agent => bareon}/objects/image.py (98%) rename {fuel_agent => bareon}/objects/operating_system.py (100%) rename {fuel_agent => bareon}/objects/partition/__init__.py (100%) rename {fuel_agent => bareon}/objects/partition/fs.py (97%) rename {fuel_agent => bareon}/objects/partition/lv.py (97%) rename {fuel_agent => bareon}/objects/partition/md.py (96%) rename {fuel_agent => bareon}/objects/partition/parted.py (98%) rename {fuel_agent => bareon}/objects/partition/pv.py (96%) rename {fuel_agent => bareon}/objects/partition/scheme.py (95%) rename {fuel_agent => bareon}/objects/partition/vg.py (96%) rename {fuel_agent => bareon}/objects/repo.py (100%) rename {fuel_agent => bareon}/openstack/__init__.py (100%) rename {fuel_agent => bareon}/openstack/common/__init__.py (100%) rename {fuel_agent => bareon}/openstack/common/config/__init__.py (100%) rename {fuel_agent => bareon}/openstack/common/config/generator.py (97%) rename {fuel_agent => bareon}/openstack/common/gettextutils.py (98%) rename {fuel_agent => bareon}/openstack/common/importutils.py (98%) rename {fuel_agent => bareon}/openstack/common/local.py (100%) rename {fuel_agent => bareon}/openstack/common/log.py (99%) rename {fuel_agent => bareon}/openstack/common/processutils.py (98%) rename {fuel_agent => bareon}/openstack/common/strutils.py (99%) rename {fuel_agent => bareon}/openstack/common/timeutils.py (100%) rename {fuel_agent => bareon}/tests/__init__.py (100%) rename {fuel_agent => bareon}/tests/base.py (100%) rename {fuel_agent => bareon}/tests/fixtures/simple_nailgun_driver.json (100%) rename {fuel_agent => bareon}/tests/test_artifact_utils.py (97%) rename {fuel_agent => bareon}/tests/test_build_utils.py (94%) rename {fuel_agent => bareon}/tests/test_configdrive.py (97%) rename {fuel_agent => bareon}/tests/test_fs_utils.py (98%) rename {fuel_agent => bareon}/tests/test_grub_utils.py (87%) rename {fuel_agent => bareon}/tests/test_hardware_utils.py (99%) rename {fuel_agent => bareon}/tests/test_image.py (92%) rename {fuel_agent => bareon}/tests/test_ks_spaces_validator.py (98%) rename {fuel_agent => bareon}/tests/test_lvm_utils.py (99%) rename {fuel_agent => bareon}/tests/test_manager.py (93%) rename {fuel_agent => bareon}/tests/test_md_utils.py (98%) rename {fuel_agent => bareon}/tests/test_nailgun.py (99%) rename {fuel_agent => bareon}/tests/test_nailgun_build_image.py (91%) rename {fuel_agent => bareon}/tests/test_partition.py (99%) rename {fuel_agent => bareon}/tests/test_partition_utils.py (99%) rename {fuel_agent => bareon}/tests/test_requirements.py (96%) rename {fuel_agent => bareon}/tests/test_simple_nailgun_driver.py (98%) rename {fuel_agent => bareon}/tests/test_utils.py (96%) rename {fuel_agent => bareon}/utils/__init__.py (100%) rename {fuel_agent => bareon}/utils/artifact.py (98%) rename {fuel_agent => bareon}/utils/build.py (98%) rename {fuel_agent => bareon}/utils/decorators.py (100%) rename {fuel_agent => bareon}/utils/fs.py (96%) rename {fuel_agent => bareon}/utils/grub.py (98%) rename {fuel_agent => bareon}/utils/hardware.py (97%) rename {fuel_agent => bareon}/utils/lvm.py (97%) rename {fuel_agent => bareon}/utils/md.py (97%) rename {fuel_agent => bareon}/utils/partition.py (98%) rename {fuel_agent => bareon}/utils/utils.py (97%) rename {fuel_agent => bareon}/version.py (91%) rename etc/{fuel-agent/fuel-agent.conf.sample => bareon/bareon.conf.sample} (93%) delete mode 100644 fuel_agent/objects/__init__.py diff --git a/README.md b/README.md index 5d653fe..f5aece7 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ bareon ├── contrib ├── debian ├── etc -├── fuel_agent +├── bareon │   ├── cmd │   ├── drivers │   ├── objects @@ -108,28 +108,28 @@ Included debian rules are mainly suitable for Ubuntu 12.04 or higher. This folder contains the sample config file for bareon. Every parameter is well documented. We use oslo-config as a configuration module. -### fuel_agent +### bareon This folder contains the python code: drivers, objects, unit tests and utils, manager and entry points. -- fuel_agent/cmd/agent.py +- bareon/cmd/agent.py * That is where executable entry points are. It reads input data and instantiates Manager class with these data. -- fuel_agent/manager.py +- bareon/manager.py * That is the file where the top level agent logic is implemented. It contains all those methods which do something useful (do_*) -- fuel_agent/drivers +- bareon/drivers * That is where input data drivers are located. (Nailgun, NailgunBuildImage, Simple etc.) Data drivers convert json into a set of python objects. -- fuel_agent/objects +- bareon/objects * Here is the place where python objects are defined. Bareon manager does not understand any particular data format except these objects. For example, to do disk partitioning we need PartitionScheme object. PartitionScheme object in turn contains disk labels, plain partitions, lvm, md, fs objects. This PartitionScheme object is to be created by input data driver. -- fuel_agent/utils +- bareon/utils * That is the place where we put the code which does something useful on the OS level. Here we have simple parted, lvm, md, grub bindings, etc. @@ -172,7 +172,7 @@ input data drivers available. Those are In order to be able to use another specific data format one can implement his own data driver and install it independently. Bareon uses stevedore to find installed drivers. -A new driver needs to be exposed via fuel_agent.driver setuptools name space. See for example +A new driver needs to be exposed via bareon.driver setuptools name space. See for example setup.cfg file where entry points are defined. One can also take a look at ```contrib``` directory for some additional examples. diff --git a/fuel_agent/__init__.py b/bareon/__init__.py similarity index 100% rename from fuel_agent/__init__.py rename to bareon/__init__.py diff --git a/fuel_agent/cmd/__init__.py b/bareon/cmd/__init__.py similarity index 100% rename from fuel_agent/cmd/__init__.py rename to bareon/cmd/__init__.py diff --git a/fuel_agent/cmd/agent.py b/bareon/cmd/agent.py similarity index 91% rename from fuel_agent/cmd/agent.py rename to bareon/cmd/agent.py index 554121c..cb5d89d 100644 --- a/fuel_agent/cmd/agent.py +++ b/bareon/cmd/agent.py @@ -18,9 +18,9 @@ from oslo_config import cfg import six import yaml -from fuel_agent import manager as manager -from fuel_agent.openstack.common import log as logging -from fuel_agent import version +from bareon import manager as manager +from bareon.openstack.common import log as logging +from bareon import version cli_opts = [ cfg.StrOpt( @@ -81,10 +81,10 @@ def handle_exception(exc): def main(actions=None): - CONF(sys.argv[1:], project='fuel-agent', + CONF(sys.argv[1:], project='bareon', version=version.version_info.release_string()) - logging.setup('fuel-agent') + logging.setup('bareon') LOG = logging.getLogger(__name__) try: diff --git a/fuel_agent/cmd/ironic_callback.py b/bareon/cmd/ironic_callback.py similarity index 98% rename from fuel_agent/cmd/ironic_callback.py rename to bareon/cmd/ironic_callback.py index 7b9420e..a9a97c9 100755 --- a/fuel_agent/cmd/ironic_callback.py +++ b/bareon/cmd/ironic_callback.py @@ -18,7 +18,7 @@ import time import requests -from fuel_agent.utils import utils +from bareon.utils import utils def _process_error(message): diff --git a/fuel_agent/drivers/__init__.py b/bareon/drivers/__init__.py similarity index 100% rename from fuel_agent/drivers/__init__.py rename to bareon/drivers/__init__.py diff --git a/fuel_agent/drivers/base.py b/bareon/drivers/base.py similarity index 100% rename from fuel_agent/drivers/base.py rename to bareon/drivers/base.py diff --git a/fuel_agent/drivers/bootstrap.py b/bareon/drivers/bootstrap.py similarity index 92% rename from fuel_agent/drivers/bootstrap.py rename to bareon/drivers/bootstrap.py index cd88d46..8e3c00f 100644 --- a/fuel_agent/drivers/bootstrap.py +++ b/bareon/drivers/bootstrap.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fuel_agent.drivers import nailgun -from fuel_agent.objects import base +from bareon.drivers import nailgun +from bareon.objects import base class BootstrapBuildImage(nailgun.NailgunBuildImage): diff --git a/fuel_agent/drivers/ks_spaces_validator.py b/bareon/drivers/ks_spaces_validator.py similarity index 98% rename from fuel_agent/drivers/ks_spaces_validator.py rename to bareon/drivers/ks_spaces_validator.py index 9274e71..ba4e6d4 100644 --- a/fuel_agent/drivers/ks_spaces_validator.py +++ b/bareon/drivers/ks_spaces_validator.py @@ -14,8 +14,8 @@ import jsonschema -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging +from bareon import errors +from bareon.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/fuel_agent/drivers/nailgun.py b/bareon/drivers/nailgun.py similarity index 98% rename from fuel_agent/drivers/nailgun.py rename to bareon/drivers/nailgun.py index f42cf15..462a24f 100644 --- a/fuel_agent/drivers/nailgun.py +++ b/bareon/drivers/nailgun.py @@ -23,20 +23,20 @@ from six.moves.urllib.parse import urlparse from six.moves.urllib.parse import urlsplit import yaml -from fuel_agent.drivers.base import BaseDataDriver -from fuel_agent.drivers import ks_spaces_validator -from fuel_agent import errors -from fuel_agent import objects -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import hardware as hu -from fuel_agent.utils import utils +from bareon.drivers.base import BaseDataDriver +from bareon.drivers import ks_spaces_validator +from bareon import errors +from bareon import objects +from bareon.openstack.common import log as logging +from bareon.utils import hardware as hu +from bareon.utils import utils LOG = logging.getLogger(__name__) CONF = cfg.CONF -CONF.import_opt('prepare_configdrive', 'fuel_agent.manager') -CONF.import_opt('config_drive_path', 'fuel_agent.manager') +CONF.import_opt('prepare_configdrive', 'bareon.manager') +CONF.import_opt('config_drive_path', 'bareon.manager') def match_device(hu_disk, ks_disk): @@ -333,7 +333,7 @@ class Nailgun(BaseDataDriver): # FIXME(agordeev): NVMe drives should be skipped as # accessing such drives during the boot typically # requires using UEFI which is still not supported - # by fuel-agent (it always installs BIOS variant of + # by bareon (it always installs BIOS variant of # grub) # * grub bug (http://savannah.gnu.org/bugs/?41883) # NOTE(kozhukalov): On some hardware GRUB is not able diff --git a/fuel_agent/drivers/simple.py b/bareon/drivers/simple.py similarity index 93% rename from fuel_agent/drivers/simple.py rename to bareon/drivers/simple.py index 6c617bc..d6d6eb6 100644 --- a/fuel_agent/drivers/simple.py +++ b/bareon/drivers/simple.py @@ -14,8 +14,8 @@ # License for the specific language governing permissions and limitations # under the License. -from fuel_agent.drivers import nailgun -from fuel_agent import objects +from bareon.drivers import nailgun +from bareon import objects class NailgunSimpleDriver(nailgun.Nailgun): @@ -23,7 +23,7 @@ class NailgunSimpleDriver(nailgun.Nailgun): This driver digest information that already has all required information how to perform partitioning. - Service that sends data to fuel_agent is responsible for preparing + Service that sends data to bareon is responsible for preparing it in correct format. """ diff --git a/fuel_agent/errors.py b/bareon/errors.py similarity index 100% rename from fuel_agent/errors.py rename to bareon/errors.py diff --git a/fuel_agent/hooks.py b/bareon/hooks.py similarity index 100% rename from fuel_agent/hooks.py rename to bareon/hooks.py diff --git a/fuel_agent/manager.py b/bareon/manager.py similarity index 98% rename from fuel_agent/manager.py rename to bareon/manager.py index 6690fac..6414604 100644 --- a/fuel_agent/manager.py +++ b/bareon/manager.py @@ -21,22 +21,22 @@ from oslo_config import cfg import six import yaml -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import artifact as au -from fuel_agent.utils import build as bu -from fuel_agent.utils import fs as fu -from fuel_agent.utils import grub as gu -from fuel_agent.utils import hardware as hw -from fuel_agent.utils import lvm as lu -from fuel_agent.utils import md as mu -from fuel_agent.utils import partition as pu -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import artifact as au +from bareon.utils import build as bu +from bareon.utils import fs as fu +from bareon.utils import grub as gu +from bareon.utils import hardware as hw +from bareon.utils import lvm as lu +from bareon.utils import md as mu +from bareon.utils import partition as pu +from bareon.utils import utils opts = [ cfg.StrOpt( 'nc_template_path', - default='/usr/share/fuel-agent/cloud-init-templates', + default='/usr/share/bareon/cloud-init-templates', help='Path to directory with cloud init templates', ), cfg.StrOpt( @@ -71,7 +71,7 @@ opts = [ ), cfg.StrOpt( 'image_build_suffix', - default='.fuel-agent-image', + default='.bareon-image', help='Suffix which is used while creating temporary files', ), cfg.IntOpt( @@ -704,7 +704,7 @@ class Manager(object): # should work with open(chroot + '/etc/udev/rules.d/70-persistent-net.rules', 'wt', encoding='utf-8') as f: - f.write(u'# Generated by fuel-agent during provisioning: ' + f.write(u'# Generated by bareon during provisioning: ' u'BEGIN\n') # pattern is aa:bb:cc:dd:ee:ff_eth0,aa:bb:cc:dd:ee:ff_eth1 for mapping in self.driver.configdrive_scheme. \ @@ -715,13 +715,13 @@ class Manager(object): u'KERNEL=="eth*", NAME="%s"\n' % (mac_addr, nic_name)) f.write( - u'# Generated by fuel-agent during provisioning: END\n') + u'# Generated by bareon during provisioning: END\n') # FIXME(agordeev): Disable net-generator that will add new etries # to 70-persistent-net.rules with open(chroot + '/etc/udev/rules.d/' '75-persistent-net-generator.rules', 'wt', encoding='utf-8') as f: - f.write(u'# Generated by fuel-agent during provisioning:\n' + f.write(u'# Generated by bareon during provisioning:\n' u'# DO NOT DELETE. It is needed to disable ' u'net-generator\n') diff --git a/bareon/objects/__init__.py b/bareon/objects/__init__.py new file mode 100644 index 0000000..d97eac2 --- /dev/null +++ b/bareon/objects/__init__.py @@ -0,0 +1,73 @@ +# Copyright 2014 Mirantis, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +from bareon.objects.bootloader import Grub +from bareon.objects.configdrive import ConfigDriveCommon +from bareon.objects.configdrive import ConfigDriveMcollective +from bareon.objects.configdrive import ConfigDrivePuppet +from bareon.objects.configdrive import ConfigDriveScheme +from bareon.objects.device import Loop +from bareon.objects.image import Image +from bareon.objects.image import ImageScheme +from bareon.objects.operating_system import Centos +from bareon.objects.operating_system import OperatingSystem +from bareon.objects.operating_system import Ubuntu +from bareon.objects.partition.fs import FileSystem +from bareon.objects.partition.lv import LogicalVolume +from bareon.objects.partition.md import MultipleDevice +from bareon.objects.partition.parted import Parted +from bareon.objects.partition.parted import Partition +from bareon.objects.partition.pv import PhysicalVolume +from bareon.objects.partition.scheme import PartitionScheme +from bareon.objects.partition.vg import VolumeGroup +from bareon.objects.repo import DEBRepo +from bareon.objects.repo import Repo +from bareon.objects.repo import RepoProxies + + +PV = PhysicalVolume +VG = VolumeGroup +LV = LogicalVolume +MD = MultipleDevice +FS = FileSystem + + +__all__ = [ + 'Partition', + 'Parted', + 'PhysicalVolume', + 'PV', + 'VolumeGroup', + 'VG', + 'LogicalVolume', + 'LV', + 'MultipleDevice', + 'MD', + 'FileSystem', + 'FS', + 'PartitionScheme', + 'ConfigDriveCommon', + 'ConfigDrivePuppet', + 'ConfigDriveMcollective', + 'ConfigDriveScheme', + 'Image', + 'ImageScheme', + 'Grub', + 'OperatingSystem', + 'Ubuntu', + 'Centos', + 'Repo', + 'DEBRepo', + 'Loop', + 'RepoProxies' +] diff --git a/fuel_agent/objects/base.py b/bareon/objects/base.py similarity index 100% rename from fuel_agent/objects/base.py rename to bareon/objects/base.py diff --git a/fuel_agent/objects/bootloader.py b/bareon/objects/bootloader.py similarity index 100% rename from fuel_agent/objects/bootloader.py rename to bareon/objects/bootloader.py diff --git a/fuel_agent/objects/configdrive.py b/bareon/objects/configdrive.py similarity index 99% rename from fuel_agent/objects/configdrive.py rename to bareon/objects/configdrive.py index 922991c..f1e24b2 100644 --- a/fuel_agent/objects/configdrive.py +++ b/bareon/objects/configdrive.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fuel_agent import errors +from bareon import errors class ConfigDriveCommon(object): diff --git a/fuel_agent/objects/device.py b/bareon/objects/device.py similarity index 96% rename from fuel_agent/objects/device.py rename to bareon/objects/device.py index eec4bdd..f271712 100644 --- a/fuel_agent/objects/device.py +++ b/bareon/objects/device.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fuel_agent import errors +from bareon import errors class Loop(object): diff --git a/fuel_agent/objects/image.py b/bareon/objects/image.py similarity index 98% rename from fuel_agent/objects/image.py rename to bareon/objects/image.py index a143dce..fad5ba6 100644 --- a/fuel_agent/objects/image.py +++ b/bareon/objects/image.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fuel_agent import errors +from bareon import errors class Image(object): diff --git a/fuel_agent/objects/operating_system.py b/bareon/objects/operating_system.py similarity index 100% rename from fuel_agent/objects/operating_system.py rename to bareon/objects/operating_system.py diff --git a/fuel_agent/objects/partition/__init__.py b/bareon/objects/partition/__init__.py similarity index 100% rename from fuel_agent/objects/partition/__init__.py rename to bareon/objects/partition/__init__.py diff --git a/fuel_agent/objects/partition/fs.py b/bareon/objects/partition/fs.py similarity index 97% rename from fuel_agent/objects/partition/fs.py rename to bareon/objects/partition/fs.py index aaf1200..37034b7 100644 --- a/fuel_agent/objects/partition/fs.py +++ b/bareon/objects/partition/fs.py @@ -13,7 +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. -from fuel_agent.objects import base +from bareon.objects import base class FileSystem(base.Serializable): diff --git a/fuel_agent/objects/partition/lv.py b/bareon/objects/partition/lv.py similarity index 97% rename from fuel_agent/objects/partition/lv.py rename to bareon/objects/partition/lv.py index 6809ce1..197080c 100644 --- a/fuel_agent/objects/partition/lv.py +++ b/bareon/objects/partition/lv.py @@ -13,7 +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. -from fuel_agent.objects import base +from bareon.objects import base class LogicalVolume(base.Serializable): diff --git a/fuel_agent/objects/partition/md.py b/bareon/objects/partition/md.py similarity index 96% rename from fuel_agent/objects/partition/md.py rename to bareon/objects/partition/md.py index 4b310ee..0f6f5fd 100644 --- a/fuel_agent/objects/partition/md.py +++ b/bareon/objects/partition/md.py @@ -13,8 +13,8 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from fuel_agent import errors -from fuel_agent.objects import base +from bareon import errors +from bareon.objects import base class MultipleDevice(base.Serializable): diff --git a/fuel_agent/objects/partition/parted.py b/bareon/objects/partition/parted.py similarity index 98% rename from fuel_agent/objects/partition/parted.py rename to bareon/objects/partition/parted.py index 1496409..425d548 100644 --- a/fuel_agent/objects/partition/parted.py +++ b/bareon/objects/partition/parted.py @@ -16,8 +16,8 @@ import copy -from fuel_agent.objects import base -from fuel_agent.openstack.common import log as logging +from bareon.objects import base +from bareon.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/fuel_agent/objects/partition/pv.py b/bareon/objects/partition/pv.py similarity index 96% rename from fuel_agent/objects/partition/pv.py rename to bareon/objects/partition/pv.py index 70a5213..5dc80c4 100644 --- a/fuel_agent/objects/partition/pv.py +++ b/bareon/objects/partition/pv.py @@ -13,7 +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. -from fuel_agent.objects import base +from bareon.objects import base class PhysicalVolume(base.Serializable): diff --git a/fuel_agent/objects/partition/scheme.py b/bareon/objects/partition/scheme.py similarity index 95% rename from fuel_agent/objects/partition/scheme.py rename to bareon/objects/partition/scheme.py index 8771377..8fedcfd 100644 --- a/fuel_agent/objects/partition/scheme.py +++ b/bareon/objects/partition/scheme.py @@ -15,15 +15,15 @@ # under the License. import os -from fuel_agent import errors -from fuel_agent.objects.partition.fs import FileSystem -from fuel_agent.objects.partition.lv import LogicalVolume -from fuel_agent.objects.partition.md import MultipleDevice -from fuel_agent.objects.partition.parted import Parted -from fuel_agent.objects.partition.pv import PhysicalVolume -from fuel_agent.objects.partition.vg import VolumeGroup +from bareon import errors +from bareon.objects.partition.fs import FileSystem +from bareon.objects.partition.lv import LogicalVolume +from bareon.objects.partition.md import MultipleDevice +from bareon.objects.partition.parted import Parted +from bareon.objects.partition.pv import PhysicalVolume +from bareon.objects.partition.vg import VolumeGroup -from fuel_agent.openstack.common import log as logging +from bareon.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/fuel_agent/objects/partition/vg.py b/bareon/objects/partition/vg.py similarity index 96% rename from fuel_agent/objects/partition/vg.py rename to bareon/objects/partition/vg.py index 0c4a92a..7ffb9e5 100644 --- a/fuel_agent/objects/partition/vg.py +++ b/bareon/objects/partition/vg.py @@ -13,7 +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. -from fuel_agent.objects import base +from bareon.objects import base class VolumeGroup(base.Serializable): diff --git a/fuel_agent/objects/repo.py b/bareon/objects/repo.py similarity index 100% rename from fuel_agent/objects/repo.py rename to bareon/objects/repo.py diff --git a/fuel_agent/openstack/__init__.py b/bareon/openstack/__init__.py similarity index 100% rename from fuel_agent/openstack/__init__.py rename to bareon/openstack/__init__.py diff --git a/fuel_agent/openstack/common/__init__.py b/bareon/openstack/common/__init__.py similarity index 100% rename from fuel_agent/openstack/common/__init__.py rename to bareon/openstack/common/__init__.py diff --git a/fuel_agent/openstack/common/config/__init__.py b/bareon/openstack/common/config/__init__.py similarity index 100% rename from fuel_agent/openstack/common/config/__init__.py rename to bareon/openstack/common/config/__init__.py diff --git a/fuel_agent/openstack/common/config/generator.py b/bareon/openstack/common/config/generator.py similarity index 97% rename from fuel_agent/openstack/common/config/generator.py rename to bareon/openstack/common/config/generator.py index b078d02..93c5628 100644 --- a/fuel_agent/openstack/common/config/generator.py +++ b/bareon/openstack/common/config/generator.py @@ -31,10 +31,10 @@ from oslo_config import cfg import six import stevedore.named -from fuel_agent.openstack.common import gettextutils -from fuel_agent.openstack.common import importutils +from bareon.openstack.common import gettextutils +from bareon.openstack.common import importutils -gettextutils.install('fuel_agent') +gettextutils.install('bareon') STROPT = "StrOpt" BOOLOPT = "BoolOpt" @@ -238,11 +238,11 @@ def _sanitize_default(name, value): return '10.0.0.1' elif value in (hostname, fqdn): if 'host' in name: - return 'fuel_agent' + return 'bareon' elif value.endswith(hostname): - return value.replace(hostname, 'fuel_agent') + return value.replace(hostname, 'bareon') elif value.endswith(fqdn): - return value.replace(fqdn, 'fuel_agent') + return value.replace(fqdn, 'bareon') elif value.strip() != value: return '"%s"' % value return value diff --git a/fuel_agent/openstack/common/gettextutils.py b/bareon/openstack/common/gettextutils.py similarity index 98% rename from fuel_agent/openstack/common/gettextutils.py rename to bareon/openstack/common/gettextutils.py index f0bf7c9..68138f6 100644 --- a/fuel_agent/openstack/common/gettextutils.py +++ b/bareon/openstack/common/gettextutils.py @@ -19,7 +19,7 @@ gettext for openstack-common modules. Usual usage in an openstack.common module: - from fuel_agent.openstack.common.gettextutils import _ + from bareon.openstack.common.gettextutils import _ """ import copy @@ -120,7 +120,7 @@ class TranslatorFactory(object): # module within each application. # Create the global translation functions. -_translators = TranslatorFactory('fuel_agent') +_translators = TranslatorFactory('bareon') # The primary translation function using the well-known name "_" _ = _translators.primary @@ -150,7 +150,7 @@ def enable_lazy(): # FIXME(dhellmann): This function will be removed in oslo.i18n, # because the TranslatorFactory makes it superfluous. global _, _LI, _LW, _LE, _LC, USE_LAZY - tf = TranslatorFactory('fuel_agent', lazy=True) + tf = TranslatorFactory('bareon', lazy=True) _ = tf.primary _LI = tf.log_info _LW = tf.log_warning @@ -201,7 +201,7 @@ class Message(six.text_type): """ def __new__(cls, msgid, msgtext=None, params=None, - domain='fuel_agent', *args): + domain='bareon', *args): """Create a new Message object. In order for translation to work gettext requires a message ID, this diff --git a/fuel_agent/openstack/common/importutils.py b/bareon/openstack/common/importutils.py similarity index 98% rename from fuel_agent/openstack/common/importutils.py rename to bareon/openstack/common/importutils.py index 5386c01..08299bc 100644 --- a/fuel_agent/openstack/common/importutils.py +++ b/bareon/openstack/common/importutils.py @@ -59,7 +59,7 @@ def import_module(import_str): def import_versioned_module(version, submodule=None): - module = 'fuel_agent.v%s' % version + module = 'bareon.v%s' % version if submodule: module = '.'.join((module, submodule)) return import_module(module) diff --git a/fuel_agent/openstack/common/local.py b/bareon/openstack/common/local.py similarity index 100% rename from fuel_agent/openstack/common/local.py rename to bareon/openstack/common/local.py diff --git a/fuel_agent/openstack/common/log.py b/bareon/openstack/common/log.py similarity index 99% rename from fuel_agent/openstack/common/log.py rename to bareon/openstack/common/log.py index 44715af..eff47a8 100644 --- a/fuel_agent/openstack/common/log.py +++ b/bareon/openstack/common/log.py @@ -42,9 +42,9 @@ from oslo_serialization import jsonutils import six from six import moves -from fuel_agent.openstack.common.gettextutils import _ -from fuel_agent.openstack.common import importutils -from fuel_agent.openstack.common import local +from bareon.openstack.common.gettextutils import _ +from bareon.openstack.common import importutils +from bareon.openstack.common import local _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" @@ -542,7 +542,7 @@ def _setup_logging_from_conf(project, version): if CONF.publish_errors: handler = importutils.import_object( - "fuel_agent.openstack.common.log_handler.PublishErrorsHandler", + "bareon.openstack.common.log_handler.PublishErrorsHandler", logging.ERROR) log_root.addHandler(handler) diff --git a/fuel_agent/openstack/common/processutils.py b/bareon/openstack/common/processutils.py similarity index 98% rename from fuel_agent/openstack/common/processutils.py rename to bareon/openstack/common/processutils.py index 2033232..70f7e31 100644 --- a/fuel_agent/openstack/common/processutils.py +++ b/bareon/openstack/common/processutils.py @@ -28,8 +28,8 @@ from eventlet.green import subprocess from eventlet import greenthread import six -from fuel_agent.openstack.common.gettextutils import _ -from fuel_agent.openstack.common import log as logging +from bareon.openstack.common.gettextutils import _ +from bareon.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/fuel_agent/openstack/common/strutils.py b/bareon/openstack/common/strutils.py similarity index 99% rename from fuel_agent/openstack/common/strutils.py rename to bareon/openstack/common/strutils.py index 2331681..66b4a11 100644 --- a/fuel_agent/openstack/common/strutils.py +++ b/bareon/openstack/common/strutils.py @@ -24,7 +24,7 @@ import unicodedata import six -from fuel_agent.openstack.common.gettextutils import _ +from bareon.openstack.common.gettextutils import _ UNIT_PREFIX_EXPONENT = { diff --git a/fuel_agent/openstack/common/timeutils.py b/bareon/openstack/common/timeutils.py similarity index 100% rename from fuel_agent/openstack/common/timeutils.py rename to bareon/openstack/common/timeutils.py diff --git a/fuel_agent/tests/__init__.py b/bareon/tests/__init__.py similarity index 100% rename from fuel_agent/tests/__init__.py rename to bareon/tests/__init__.py diff --git a/fuel_agent/tests/base.py b/bareon/tests/base.py similarity index 100% rename from fuel_agent/tests/base.py rename to bareon/tests/base.py diff --git a/fuel_agent/tests/fixtures/simple_nailgun_driver.json b/bareon/tests/fixtures/simple_nailgun_driver.json similarity index 100% rename from fuel_agent/tests/fixtures/simple_nailgun_driver.json rename to bareon/tests/fixtures/simple_nailgun_driver.json diff --git a/fuel_agent/tests/test_artifact_utils.py b/bareon/tests/test_artifact_utils.py similarity index 97% rename from fuel_agent/tests/test_artifact_utils.py rename to bareon/tests/test_artifact_utils.py index 2cdde06..4fe9ef9 100644 --- a/fuel_agent/tests/test_artifact_utils.py +++ b/bareon/tests/test_artifact_utils.py @@ -17,9 +17,9 @@ from oslo_config import cfg import unittest2 import zlib -from fuel_agent import errors -from fuel_agent.utils import artifact as au -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import artifact as au +from bareon.utils import utils CONF = cfg.CONF diff --git a/fuel_agent/tests/test_build_utils.py b/bareon/tests/test_build_utils.py similarity index 94% rename from fuel_agent/tests/test_build_utils.py rename to bareon/tests/test_build_utils.py index d6d2895..630fde8 100644 --- a/fuel_agent/tests/test_build_utils.py +++ b/bareon/tests/test_build_utils.py @@ -19,10 +19,10 @@ import signal import mock import unittest2 -from fuel_agent import errors -from fuel_agent.utils import build as bu -from fuel_agent.utils import hardware as hu -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import build as bu +from bareon.utils import hardware as hu +from bareon.utils import utils class BuildUtilsTestCase(unittest2.TestCase): @@ -37,7 +37,7 @@ class BuildUtilsTestCase(unittest2.TestCase): def setUp(self): super(BuildUtilsTestCase, self).setUp() - @mock.patch('fuel_agent.utils.build.os', environ={}) + @mock.patch('bareon.utils.build.os', environ={}) @mock.patch.object(utils, 'execute', return_value=(None, None)) def test_run_debootstrap(self, mock_exec, mock_environ): bu.run_debootstrap('uri', 'suite', 'chroot', 'arch', attempts=2) @@ -46,7 +46,7 @@ class BuildUtilsTestCase(unittest2.TestCase): 'suite', 'chroot', 'uri', attempts=2, env_variables={}) - @mock.patch('fuel_agent.utils.build.os', environ={}) + @mock.patch('bareon.utils.build.os', environ={}) @mock.patch.object(utils, 'execute', return_value=(None, None)) def test_run_debootstrap_eatmydata(self, mock_exec, mock_environ): bu.run_debootstrap('uri', 'suite', 'chroot', 'arch', eatmydata=True, @@ -162,15 +162,15 @@ class BuildUtilsTestCase(unittest2.TestCase): files = set(['etc/apt/sources.list', 'etc/apt/preferences', 'etc/apt/apt.conf.d/%s' % 'force_ipv4', 'etc/apt/apt.conf.d/%s' % 'unsigned', - 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-ftp', - 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-http', - 'etc/apt/apt.conf.d/01fuel_agent-use-proxy-https']) + 'etc/apt/apt.conf.d/01bareon-use-proxy-ftp', + 'etc/apt/apt.conf.d/01bareon-use-proxy-http', + 'etc/apt/apt.conf.d/01bareon-use-proxy-https']) self.assertEqual('chroot', mock_files.call_args[0][0]) self.assertEqual(files, set(mock_files.call_args[0][1])) - @mock.patch('fuel_agent.utils.build.open', + @mock.patch('bareon.utils.build.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.utils.build.os.path') + @mock.patch('bareon.utils.build.os.path') @mock.patch.object(bu, 'clean_apt_settings') @mock.patch.object(bu, 'remove_files') @mock.patch.object(utils, 'execute') @@ -206,9 +206,9 @@ class BuildUtilsTestCase(unittest2.TestCase): self.assertEqual(mock_path_join_expected_calls, mock_path.join.call_args_list) - @mock.patch('fuel_agent.utils.build.open', + @mock.patch('bareon.utils.build.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.utils.build.time.sleep') + @mock.patch('bareon.utils.build.time.sleep') @mock.patch.object(os, 'kill') @mock.patch.object(os, 'readlink', return_value='chroot') @mock.patch.object(utils, 'execute') @@ -353,7 +353,7 @@ class BuildUtilsTestCase(unittest2.TestCase): mock_path.join.call_args_list) @mock.patch.object(os, 'path') - @mock.patch('fuel_agent.utils.build.utils.init_http_request', + @mock.patch('bareon.utils.build.utils.init_http_request', return_value=mock.Mock(text=_fake_ubuntu_release)) def test_add_apt_preference(self, mock_get, mock_path): with mock.patch('six.moves.builtins.open', create=True) as mock_open: @@ -390,7 +390,7 @@ class BuildUtilsTestCase(unittest2.TestCase): mock_path.join.call_args_list) @mock.patch.object(os, 'path') - @mock.patch('fuel_agent.utils.build.utils.init_http_request', + @mock.patch('bareon.utils.build.utils.init_http_request', return_value=mock.Mock(text=_fake_ubuntu_release)) def test_add_apt_preference_multuple_sections(self, mock_get, mock_path): with mock.patch('six.moves.builtins.open', create=True) as mock_open: @@ -433,7 +433,7 @@ class BuildUtilsTestCase(unittest2.TestCase): mock_path.join.call_args_list) @mock.patch.object(os, 'path') - @mock.patch('fuel_agent.utils.build.utils.init_http_request', + @mock.patch('bareon.utils.build.utils.init_http_request', return_value=mock.Mock(text=_fake_ubuntu_release)) def test_add_apt_preference_no_sections(self, mock_get, mock_path): with mock.patch('six.moves.builtins.open', create=True) as mock_open: @@ -520,8 +520,8 @@ class BuildUtilsTestCase(unittest2.TestCase): self.assertRaises(errors.WrongImageDataError, bu.containerize, 'file', 'fake') - @mock.patch('fuel_agent.utils.build.get_free_loop_device') - @mock.patch('fuel_agent.utils.build.attach_file_to_loop') + @mock.patch('bareon.utils.build.get_free_loop_device') + @mock.patch('bareon.utils.build.attach_file_to_loop') def test_do_build_image_retries_attach_image_max_attempts_exceeded( self, mock_attach_file, mock_get_free_loop_device): @@ -534,8 +534,8 @@ class BuildUtilsTestCase(unittest2.TestCase): self.assertEqual(mock_attach_file.call_count, 3) - @mock.patch('fuel_agent.utils.build.get_free_loop_device') - @mock.patch('fuel_agent.utils.build.attach_file_to_loop') + @mock.patch('bareon.utils.build.get_free_loop_device') + @mock.patch('bareon.utils.build.attach_file_to_loop') def test_do_build_image_retries_attach_image( self, mock_attach_file, mock_get_free_loop_device): @@ -573,12 +573,12 @@ class BuildUtilsTestCase(unittest2.TestCase): mock_exec.assert_called_once_with('rsync', '-rlptDKv', src + '/', dst + '/', logged=True) - @mock.patch('fuel_agent.utils.build.open', + @mock.patch('bareon.utils.build.open', create=True, new_callable=mock.mock_open) @mock.patch.object(utils, 'makedirs_if_not_exists') @mock.patch.object(os, 'path', return_value=True) - @mock.patch('fuel_agent.utils.build.yaml.load', return_value={'test': 22}) - @mock.patch('fuel_agent.utils.build.yaml.safe_dump') + @mock.patch('bareon.utils.build.yaml.load', return_value={'test': 22}) + @mock.patch('bareon.utils.build.yaml.safe_dump') def test_dump_runtime_uuid(self, mock_open, mock_makedirs_if_not_exists, mock_os, mock_load_yaml, mock_safe_dump_yaml): uuid = "8" @@ -619,7 +619,7 @@ class BuildUtilsTestCase(unittest2.TestCase): @mock.patch.object(utils, 'makedirs_if_not_exists') @mock.patch.object(utils, 'execute') - @mock.patch('fuel_agent.utils.build.uuid.uuid4', return_value='fake_uuid') + @mock.patch('bareon.utils.build.uuid.uuid4', return_value='fake_uuid') def test_make_targz(self, mock_uuid, mock_exec, mock_makedirs): self.assertEqual(bu.make_targz('/test/path'), 'fake_uuid.tar.gz') mock_exec.assert_called_with('tar', '-czf', 'fake_uuid.tar.gz', @@ -646,8 +646,8 @@ class BuildUtilsTestCase(unittest2.TestCase): @mock.patch.object(utils, 'execute') @mock.patch.object(bu, 'remove_files') - @mock.patch('fuel_agent.utils.build.glob.glob', return_value=[]) - @mock.patch('fuel_agent.utils.build.os', environ={}) + @mock.patch('bareon.utils.build.glob.glob', return_value=[]) + @mock.patch('bareon.utils.build.os', environ={}) def test_recompress_initramfs(self, mock_os, mock_glob, mock_rm_files, mock_exec): bu.recompress_initramfs('/test/path') @@ -671,7 +671,7 @@ class BuildUtilsTestCase(unittest2.TestCase): @mock.patch.object(utils, 'makedirs_if_not_exists') @mock.patch.object(utils, 'execute') - @mock.patch('fuel_agent.utils.build.glob.glob') + @mock.patch('bareon.utils.build.glob.glob') @mock.patch.object(shutil, 'copy') def test_copy_kernel_initramfs(self, mock_copy, mock_glob, mock_exec, mock_makedirs): @@ -687,7 +687,7 @@ class BuildUtilsTestCase(unittest2.TestCase): @mock.patch.object(utils, 'makedirs_if_not_exists') @mock.patch.object(utils, 'execute') - @mock.patch('fuel_agent.utils.build.glob.glob') + @mock.patch('bareon.utils.build.glob.glob') @mock.patch.object(shutil, 'copy') @mock.patch.object(bu, 'remove_files') def test_copy_kernel_initramfs_with_remove(self, mock_rm, mock_copy, @@ -711,10 +711,10 @@ class BuildUtilsTestCase(unittest2.TestCase): @mock.patch.object(utils, 'makedirs_if_not_exists') @mock.patch.object(utils, 'execute') @mock.patch.object(shutil, 'move') - @mock.patch('fuel_agent.utils.build.fu.mount_fs') - @mock.patch('fuel_agent.utils.build.fu.umount_fs') + @mock.patch('bareon.utils.build.fu.mount_fs') + @mock.patch('bareon.utils.build.fu.umount_fs') @mock.patch.object(bu, 'stop_chrooted_processes') - @mock.patch('fuel_agent.utils.build.uuid.uuid4', return_value='fake_uuid') + @mock.patch('bareon.utils.build.uuid.uuid4', return_value='fake_uuid') def test_run_mksquashfs(self, mock_uuid, mock_stop_proc, mock_umount, mock_mount, mock_move, mock_exec, mock_makedirs): bu.run_mksquashfs('/test/dst/dir') @@ -744,10 +744,10 @@ class BuildUtilsTestCase(unittest2.TestCase): @mock.patch.object(utils, 'makedirs_if_not_exists') @mock.patch.object(utils, 'execute') @mock.patch.object(shutil, 'move') - @mock.patch('fuel_agent.utils.build.fu.mount_fs') - @mock.patch('fuel_agent.utils.build.fu.umount_fs') + @mock.patch('bareon.utils.build.fu.mount_fs') + @mock.patch('bareon.utils.build.fu.umount_fs') @mock.patch.object(bu, 'stop_chrooted_processes') - @mock.patch('fuel_agent.utils.build.uuid.uuid4', return_value='fake_uuid') + @mock.patch('bareon.utils.build.uuid.uuid4', return_value='fake_uuid') def test_run_mksquashfs_with_name(self, mock_uuid, mock_stop_proc, mock_umount, mock_mount, mock_move, mock_exec, mock_makedirs): diff --git a/fuel_agent/tests/test_configdrive.py b/bareon/tests/test_configdrive.py similarity index 97% rename from fuel_agent/tests/test_configdrive.py rename to bareon/tests/test_configdrive.py index ea876de..33929bb 100644 --- a/fuel_agent/tests/test_configdrive.py +++ b/bareon/tests/test_configdrive.py @@ -15,8 +15,8 @@ import unittest2 -from fuel_agent import errors -from fuel_agent.objects import configdrive +from bareon import errors +from bareon.objects import configdrive class TestConfigDriveScheme(unittest2.TestCase): diff --git a/fuel_agent/tests/test_fs_utils.py b/bareon/tests/test_fs_utils.py similarity index 98% rename from fuel_agent/tests/test_fs_utils.py rename to bareon/tests/test_fs_utils.py index e6f6df4..1742c8a 100644 --- a/fuel_agent/tests/test_fs_utils.py +++ b/bareon/tests/test_fs_utils.py @@ -15,9 +15,9 @@ import mock import unittest2 -from fuel_agent import errors -from fuel_agent.utils import fs as fu -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import fs as fu +from bareon.utils import utils @mock.patch.object(utils, 'execute') diff --git a/fuel_agent/tests/test_grub_utils.py b/bareon/tests/test_grub_utils.py similarity index 87% rename from fuel_agent/tests/test_grub_utils.py rename to bareon/tests/test_grub_utils.py index 35e4d8d..447e763 100644 --- a/fuel_agent/tests/test_grub_utils.py +++ b/bareon/tests/test_grub_utils.py @@ -18,13 +18,13 @@ import mock from six import StringIO import unittest2 -from fuel_agent import errors -from fuel_agent.utils import grub as gu +from bareon import errors +from bareon.utils import grub as gu class TestGrubUtils(unittest2.TestCase): - @mock.patch('fuel_agent.utils.grub.os.path.isdir') + @mock.patch('bareon.utils.grub.os.path.isdir') def test_guess_grub2_conf(self, mock_isdir): side_effect_values = { '/target/boot/grub': True, @@ -45,12 +45,12 @@ class TestGrubUtils(unittest2.TestCase): self.assertEqual(gu.guess_grub2_conf('/target'), '/boot/grub2/grub.cfg') - @mock.patch('fuel_agent.utils.grub.os.path.isdir', return_value=False) + @mock.patch('bareon.utils.grub.os.path.isdir', return_value=False) def test_guess_grub2_conf_not_found(self, mock_isdir): self.assertRaises(errors.GrubUtilsError, gu.guess_grub2_conf, '/target') - @mock.patch('fuel_agent.utils.grub.os.path.isfile') + @mock.patch('bareon.utils.grub.os.path.isfile') def test_guess_grub2_default(self, mock_isfile): side_effect_values = { '/target/etc/default/grub': True, @@ -71,17 +71,17 @@ class TestGrubUtils(unittest2.TestCase): self.assertEqual(gu.guess_grub2_default('/target'), '/etc/sysconfig/grub') - @mock.patch('fuel_agent.utils.grub.os.path.isfile', return_value=False) + @mock.patch('bareon.utils.grub.os.path.isfile', return_value=False) def test_guess_grub2_default_not_found(self, mock_isfile): self.assertRaises(errors.GrubUtilsError, gu.guess_grub2_default, '/target') - @mock.patch('fuel_agent.utils.grub.os.path.isfile', return_value=False) + @mock.patch('bareon.utils.grub.os.path.isfile', return_value=False) def test_guess_grub2_mkconfig_not_found(self, mock_isfile): self.assertRaises(errors.GrubUtilsError, gu.guess_grub2_mkconfig, '/target') - @mock.patch('fuel_agent.utils.grub.os.path.isfile') + @mock.patch('bareon.utils.grub.os.path.isfile') def test_guess_grub2_mkconfig(self, mock_isfile): side_effect_values = { '/target/sbin/grub-mkconfig': True, @@ -124,8 +124,8 @@ class TestGrubUtils(unittest2.TestCase): self.assertEqual(gu.guess_grub2_mkconfig('/target'), '/usr/sbin/grub2-mkconfig') - @mock.patch('fuel_agent.utils.grub.guess_grub_install') - @mock.patch('fuel_agent.utils.grub.utils.execute') + @mock.patch('bareon.utils.grub.guess_grub_install') + @mock.patch('bareon.utils.grub.utils.execute') def test_guess_grub_version_1(self, mock_exec, mock_ggi): mock_ggi.return_value = '/grub_install' mock_exec.return_value = ('foo 0.97 bar', '') @@ -134,8 +134,8 @@ class TestGrubUtils(unittest2.TestCase): mock_exec.assert_called_once_with(*cmd) self.assertEqual(version, 1) - @mock.patch('fuel_agent.utils.grub.guess_grub_install') - @mock.patch('fuel_agent.utils.grub.utils.execute') + @mock.patch('bareon.utils.grub.guess_grub_install') + @mock.patch('bareon.utils.grub.utils.execute') def test_guess_grub_version_2(self, mock_exec, mock_ggi): mock_ggi.return_value = '/grub_install' mock_exec.return_value = ('foo bar', '') @@ -144,7 +144,7 @@ class TestGrubUtils(unittest2.TestCase): mock_exec.assert_called_once_with(*cmd) self.assertEqual(version, 2) - @mock.patch('fuel_agent.utils.grub.os.path.isfile') + @mock.patch('bareon.utils.grub.os.path.isfile') def test_guess_grub(self, mock_isfile): side_effect_values = { '/target/sbin/grub': True, @@ -171,12 +171,12 @@ class TestGrubUtils(unittest2.TestCase): } self.assertRaises(errors.GrubUtilsError, gu.guess_grub, '/target') - @mock.patch('fuel_agent.utils.grub.os.path.isfile', return_value=False) + @mock.patch('bareon.utils.grub.os.path.isfile', return_value=False) def test_guess_grub_install_not_found(self, mock_isfile): self.assertRaises(errors.GrubUtilsError, gu.guess_grub_install, '/target') - @mock.patch('fuel_agent.utils.grub.os.path.isfile') + @mock.patch('bareon.utils.grub.os.path.isfile') def test_guess_grub_install(self, mock_isfile): side_effect_values = { '/target/sbin/grub-install': True, @@ -219,25 +219,25 @@ class TestGrubUtils(unittest2.TestCase): self.assertEqual(gu.guess_grub_install('/target'), '/usr/sbin/grub2-install') - @mock.patch('fuel_agent.utils.grub.os.listdir') + @mock.patch('bareon.utils.grub.os.listdir') def test_guess_grub1_datadir_default(self, mock_listdir): mock_listdir.return_value = ['dir', 'x86_64_dir'] self.assertEqual('/usr/share/grub/x86_64_dir', gu.guess_grub1_datadir('/target')) - @mock.patch('fuel_agent.utils.grub.os.listdir') + @mock.patch('bareon.utils.grub.os.listdir') def test_guess_grub1_datadir_arch(self, mock_listdir): mock_listdir.return_value = ['dir', 'x86_64_dir', 'i386_dir'] self.assertEqual('/usr/share/grub/i386_dir', gu.guess_grub1_datadir('/target', 'i386')) - @mock.patch('fuel_agent.utils.grub.os.listdir') + @mock.patch('bareon.utils.grub.os.listdir') def test_guess_grub1_datadir_not_found(self, mock_listdir): mock_listdir.return_value = ['dir', 'x86_64_dir', 'i386_dir'] self.assertRaises(errors.GrubUtilsError, gu.guess_grub1_datadir, '/target', 'fake_arch') - @mock.patch('fuel_agent.utils.grub.utils.guess_filename') + @mock.patch('bareon.utils.grub.utils.guess_filename') def test_guess_kernel(self, mock_guess): mock_guess.return_value = 'vmlinuz-version' self.assertEqual(gu.guess_kernel('/target'), 'vmlinuz-version') @@ -255,7 +255,7 @@ class TestGrubUtils(unittest2.TestCase): mock_guess.return_value = None self.assertRaises(errors.GrubUtilsError, gu.guess_kernel, '/target') - @mock.patch('fuel_agent.utils.grub.utils.guess_filename') + @mock.patch('bareon.utils.grub.utils.guess_filename') def test_guess_initrd(self, mock_guess): mock_guess.return_value = 'initrd-version' self.assertEqual(gu.guess_initrd('/target'), 'initrd-version') @@ -273,8 +273,8 @@ class TestGrubUtils(unittest2.TestCase): mock_guess.return_value = None self.assertRaises(errors.GrubUtilsError, gu.guess_initrd, '/target') - @mock.patch('fuel_agent.utils.grub.grub1_stage1') - @mock.patch('fuel_agent.utils.grub.grub1_mbr') + @mock.patch('bareon.utils.grub.grub1_stage1') + @mock.patch('bareon.utils.grub.grub1_mbr') def test_grub1_install(self, mock_mbr, mock_stage1): install_devices = ['/dev/foo', '/dev/bar'] expected_calls_mbr = [] @@ -289,9 +289,9 @@ class TestGrubUtils(unittest2.TestCase): self.assertRaises(errors.GrubUtilsError, gu.grub1_install, '/dev/foo', '/dev/foo', chroot='/target') - @mock.patch('fuel_agent.utils.grub.guess_grub') - @mock.patch('fuel_agent.utils.grub.os.chmod') - @mock.patch('fuel_agent.utils.grub.utils.execute') + @mock.patch('bareon.utils.grub.guess_grub') + @mock.patch('bareon.utils.grub.os.chmod') + @mock.patch('bareon.utils.grub.utils.execute') def test_grub1_mbr_install_differs_boot(self, mock_exec, mock_chmod, mock_guess): mock_guess.return_value = '/sbin/grub' @@ -308,7 +308,7 @@ class TestGrubUtils(unittest2.TestCase): script = 'cat /tmp/grub.batch | /sbin/grub --no-floppy --batch' mock_open = mock.mock_open() - with mock.patch('fuel_agent.utils.grub.open', new=mock_open, + with mock.patch('bareon.utils.grub.open', new=mock_open, create=True): gu.grub1_mbr('/dev/foo', '/dev/bar', '0', chroot='/target') self.assertEqual( @@ -326,9 +326,9 @@ class TestGrubUtils(unittest2.TestCase): 'chroot', '/target', '/tmp/grub.sh', run_as_root=True, check_exit_code=[0]) - @mock.patch('fuel_agent.utils.grub.guess_grub') - @mock.patch('fuel_agent.utils.grub.os.chmod') - @mock.patch('fuel_agent.utils.grub.utils.execute') + @mock.patch('bareon.utils.grub.guess_grub') + @mock.patch('bareon.utils.grub.os.chmod') + @mock.patch('bareon.utils.grub.utils.execute') def test_grub1_mbr_install_same_as_boot(self, mock_exec, mock_chmod, mock_guess): mock_guess.return_value = '/sbin/grub' @@ -343,7 +343,7 @@ class TestGrubUtils(unittest2.TestCase): script = 'cat /tmp/grub.batch | /sbin/grub --no-floppy --batch' mock_open = mock.mock_open() - with mock.patch('fuel_agent.utils.grub.open', new=mock_open, + with mock.patch('bareon.utils.grub.open', new=mock_open, create=True): gu.grub1_mbr('/dev/foo', '/dev/foo', '0', chroot='/target') self.assertEqual( @@ -361,11 +361,11 @@ class TestGrubUtils(unittest2.TestCase): 'chroot', '/target', '/tmp/grub.sh', run_as_root=True, check_exit_code=[0]) - @mock.patch('fuel_agent.utils.grub.shutil.copy') - @mock.patch('fuel_agent.utils.grub.guess_grub1_datadir', + @mock.patch('bareon.utils.grub.shutil.copy') + @mock.patch('bareon.utils.grub.guess_grub1_datadir', return_value='/fake_datadir') - @mock.patch('fuel_agent.utils.grub.os.remove') - @mock.patch('fuel_agent.utils.grub.os.listdir') + @mock.patch('bareon.utils.grub.os.remove') + @mock.patch('bareon.utils.grub.os.listdir') def test_grub1_stage1(self, mock_listdir, mock_remove, mock_datadir, mock_copy): mock_listdir.side_effect = [['stage1', 'stage2', 'e2fs_stage_1_5', @@ -390,8 +390,8 @@ class TestGrubUtils(unittest2.TestCase): '/target/boot/grub/jfs_stage1_5')] self.assertEqual(expected_copy_calls, mock_copy.call_args_list) - @mock.patch('fuel_agent.utils.grub.guess_kernel') - @mock.patch('fuel_agent.utils.grub.guess_initrd') + @mock.patch('bareon.utils.grub.guess_kernel') + @mock.patch('bareon.utils.grub.guess_initrd') def test_grub1_cfg_kernel_initrd_are_not_set(self, mock_initrd, mock_kernel): mock_kernel.return_value = 'kernel-version' @@ -405,7 +405,7 @@ title Default (kernel-version) """ mock_open = mock.mock_open() - with mock.patch('fuel_agent.utils.grub.open', new=mock_open, + with mock.patch('bareon.utils.grub.open', new=mock_open, create=True): gu.grub1_cfg(chroot='/target', kernel_params='kernel-params') mock_open.assert_called_once_with('/target/boot/grub/grub.conf', 'wt', @@ -423,7 +423,7 @@ title Default (kernel-version-set) """ mock_open = mock.mock_open() - with mock.patch('fuel_agent.utils.grub.open', new=mock_open, + with mock.patch('bareon.utils.grub.open', new=mock_open, create=True): gu.grub1_cfg(kernel='kernel-version-set', initrd='initrd-version-set', @@ -434,8 +434,8 @@ title Default (kernel-version-set) mock_open_file = mock_open() mock_open_file.write.assert_called_once_with(config) - @mock.patch('fuel_agent.utils.grub.utils.execute') - @mock.patch('fuel_agent.utils.grub.guess_grub_install') + @mock.patch('bareon.utils.grub.utils.execute') + @mock.patch('bareon.utils.grub.guess_grub_install') def test_grub2_install(self, mock_guess_grub, mock_exec): mock_guess_grub.return_value = '/sbin/grub' expected_calls = [ @@ -447,10 +447,10 @@ title Default (kernel-version-set) gu.grub2_install(['/dev/foo', '/dev/bar'], chroot='/target') self.assertEqual(mock_exec.call_args_list, expected_calls) - @mock.patch('fuel_agent.utils.grub.guess_grub2_conf') - @mock.patch('fuel_agent.utils.grub.guess_grub2_mkconfig') - @mock.patch('fuel_agent.utils.grub.utils.execute') - @mock.patch('fuel_agent.utils.grub.guess_grub2_default') + @mock.patch('bareon.utils.grub.guess_grub2_conf') + @mock.patch('bareon.utils.grub.guess_grub2_mkconfig') + @mock.patch('bareon.utils.grub.utils.execute') + @mock.patch('bareon.utils.grub.guess_grub2_default') def test_grub2_cfg(self, mock_def, mock_exec, mock_mkconfig, mock_conf): mock_def.return_value = '/etc/default/grub' mock_mkconfig.return_value = '/sbin/grub-mkconfig' @@ -464,7 +464,7 @@ bar GRUB_RECORDFAIL_TIMEOUT=10 """ - with mock.patch('fuel_agent.utils.grub.open', + with mock.patch('bareon.utils.grub.open', new=mock.mock_open(read_data=orig_content), create=True) as mock_open: mock_open.return_value = mock.MagicMock(spec=io.IOBase) diff --git a/fuel_agent/tests/test_hardware_utils.py b/bareon/tests/test_hardware_utils.py similarity index 99% rename from fuel_agent/tests/test_hardware_utils.py rename to bareon/tests/test_hardware_utils.py index d96f770..edfdeaa 100644 --- a/fuel_agent/tests/test_hardware_utils.py +++ b/bareon/tests/test_hardware_utils.py @@ -15,9 +15,9 @@ import six import unittest2 -from fuel_agent import errors -from fuel_agent.utils import hardware as hu -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import hardware as hu +from bareon.utils import utils if six.PY2: import mock @@ -289,7 +289,7 @@ supports-register-dump: yes } self.assertFalse(hu.is_disk('/dev/fake', bspec=bspec)) - @mock.patch('fuel_agent.utils.hardware.utils.execute') + @mock.patch('bareon.utils.hardware.utils.execute') def test_get_block_devices_from_udev_db(self, mock_exec): mock_exec.return_value = ("""P: /devices/virtual/block/loop0 N: loop0 diff --git a/fuel_agent/tests/test_image.py b/bareon/tests/test_image.py similarity index 92% rename from fuel_agent/tests/test_image.py rename to bareon/tests/test_image.py index fc1a454..ef913f9 100644 --- a/fuel_agent/tests/test_image.py +++ b/bareon/tests/test_image.py @@ -15,8 +15,8 @@ import unittest2 -from fuel_agent import errors -from fuel_agent.objects import image +from bareon import errors +from bareon.objects import image class TestImage(unittest2.TestCase): diff --git a/fuel_agent/tests/test_ks_spaces_validator.py b/bareon/tests/test_ks_spaces_validator.py similarity index 98% rename from fuel_agent/tests/test_ks_spaces_validator.py rename to bareon/tests/test_ks_spaces_validator.py index 460e067..b0e8ad4 100644 --- a/fuel_agent/tests/test_ks_spaces_validator.py +++ b/bareon/tests/test_ks_spaces_validator.py @@ -16,8 +16,8 @@ import copy import unittest2 -from fuel_agent.drivers import ks_spaces_validator as kssv -from fuel_agent import errors +from bareon.drivers import ks_spaces_validator as kssv +from bareon import errors SAMPLE_SCHEME = [ { diff --git a/fuel_agent/tests/test_lvm_utils.py b/bareon/tests/test_lvm_utils.py similarity index 99% rename from fuel_agent/tests/test_lvm_utils.py rename to bareon/tests/test_lvm_utils.py index a1150f6..418546f 100644 --- a/fuel_agent/tests/test_lvm_utils.py +++ b/bareon/tests/test_lvm_utils.py @@ -15,9 +15,9 @@ import mock import unittest2 -from fuel_agent import errors -from fuel_agent.utils import lvm as lu -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import lvm as lu +from bareon.utils import utils class TestLvmUtils(unittest2.TestCase): diff --git a/fuel_agent/tests/test_manager.py b/bareon/tests/test_manager.py similarity index 93% rename from fuel_agent/tests/test_manager.py rename to bareon/tests/test_manager.py index 6799c43..ce915c3 100644 --- a/fuel_agent/tests/test_manager.py +++ b/bareon/tests/test_manager.py @@ -20,18 +20,18 @@ from oslo_config import cfg import six import unittest2 -from fuel_agent.drivers import nailgun -from fuel_agent import errors -from fuel_agent import manager -from fuel_agent import objects -from fuel_agent.tests import test_nailgun -from fuel_agent.utils import artifact as au -from fuel_agent.utils import fs as fu -from fuel_agent.utils import hardware as hu -from fuel_agent.utils import lvm as lu -from fuel_agent.utils import md as mu -from fuel_agent.utils import partition as pu -from fuel_agent.utils import utils +from bareon.drivers import nailgun +from bareon import errors +from bareon import manager +from bareon import objects +from bareon.tests import test_nailgun +from bareon.utils import artifact as au +from bareon.utils import fs as fu +from bareon.utils import hardware as hu +from bareon.utils import lvm as lu +from bareon.utils import md as mu +from bareon.utils import partition as pu +from bareon.utils import utils if six.PY2: import mock @@ -53,7 +53,7 @@ class FakeChain(object): class TestManager(unittest2.TestCase): - @mock.patch('fuel_agent.drivers.nailgun.Nailgun.parse_image_meta', + @mock.patch('bareon.drivers.nailgun.Nailgun.parse_image_meta', return_value={}) @mock.patch.object(hu, 'list_block_devices') def setUp(self, mock_lbd, mock_image_meta): @@ -61,10 +61,10 @@ class TestManager(unittest2.TestCase): mock_lbd.return_value = test_nailgun.LIST_BLOCK_DEVICES_SAMPLE self.mgr = manager.Manager(test_nailgun.PROVISION_SAMPLE_DATA) - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.gu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.gu', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_bootloader_grub1_kernel_initrd_guessed(self, mock_umount, @@ -95,10 +95,10 @@ class TestManager(unittest2.TestCase): mock_gu.guess_kernel.assert_called_once_with( regexp='fake_kernel_regexp', chroot='/tmp/target') - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.gu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.gu', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_bootloader_grub1_kernel_initrd_set(self, mock_umount, @@ -123,11 +123,11 @@ class TestManager(unittest2.TestCase): self.assertFalse(mock_gu.guess_initrd.called) self.assertFalse(mock_gu.guess_kernel.called) - @mock.patch('fuel_agent.objects.bootloader.Grub', autospec=True) - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.objects.bootloader.Grub', autospec=True) + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.gu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.gu', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_bootloader_rootfs_uuid(self, mock_umount, mock_mount, @@ -150,7 +150,7 @@ class TestManager(unittest2.TestCase): 'root=UUID=FAKE_ROOTFS_UUID ') self.assertEqual(2, mock_grub.version) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') def test_do_bootloader_rootfs_not_found(self, mock_umount, mock_utils): mock_utils.execute.return_value = ('fake', 'fake') @@ -162,10 +162,10 @@ class TestManager(unittest2.TestCase): self.assertRaises(errors.WrongPartitionSchemeError, self.mgr.do_bootloader) - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.gu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.gu', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_bootloader_grub_version_changes( @@ -178,10 +178,10 @@ class TestManager(unittest2.TestCase): chroot='/tmp/target') self.assertEqual('expected_version', self.mgr.driver.grub.version) - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.gu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.gu', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_bootloader_grub1(self, mock_umount, mock_mount, mock_utils, @@ -207,10 +207,10 @@ class TestManager(unittest2.TestCase): self.assertFalse(mock_gu.grub2_cfg.called) self.assertFalse(mock_gu.grub2_install.called) - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.gu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.gu', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_bootloader_grub2(self, mock_umount, mock_mount, mock_utils, @@ -231,15 +231,15 @@ class TestManager(unittest2.TestCase): self.assertFalse(mock_gu.grub1_cfg.called) self.assertFalse(mock_gu.grub1_install.called) - @mock.patch('fuel_agent.manager.gu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) + @mock.patch('bareon.manager.gu', create=True) + @mock.patch('bareon.manager.utils', create=True) @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_bootloader_writes(self, mock_umount, mock_mount, mock_utils, mock_gu): # actually covers only write() calls mock_utils.execute.return_value = ('fake_UUID\n', None) - with mock.patch('fuel_agent.manager.open', create=True) as mock_open: + with mock.patch('bareon.manager.open', create=True) as mock_open: file_handle_mock = mock_open.return_value.__enter__.return_value self.mgr.do_bootloader() expected_open_calls = [ @@ -251,7 +251,7 @@ class TestManager(unittest2.TestCase): mock.call('/tmp/target/etc/fstab', 'wt', encoding='utf-8')] self.assertEqual(expected_open_calls, mock_open.call_args_list) expected_write_calls = [ - mock.call('# Generated by fuel-agent during provisioning: ' + mock.call('# Generated by bareon during provisioning: ' 'BEGIN\n'), mock.call('SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ' 'ATTR{address}=="08:00:27:79:da:80", ATTR{type}=="1"' @@ -262,9 +262,9 @@ class TestManager(unittest2.TestCase): mock.call('SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ' 'ATTR{address}=="08:00:27:b1:d7:15", ATTR{type}=="1"' ', KERNEL=="eth*", NAME="eth2"\n'), - mock.call('# Generated by fuel-agent during provisioning: ' + mock.call('# Generated by bareon during provisioning: ' 'END\n'), - mock.call('# Generated by fuel-agent during provisioning:\n# ' + mock.call('# Generated by bareon during provisioning:\n# ' 'DO NOT DELETE. It is needed to disable ' 'net-generator\n'), mock.call('UUID=fake_UUID /boot ext2 defaults 0 0\n'), @@ -281,7 +281,7 @@ class TestManager(unittest2.TestCase): mock_utils.makedirs_if_not_exists.assert_called_once_with( '/tmp/target/etc/nailgun-agent') - @mock.patch('fuel_agent.drivers.nailgun.Nailgun.parse_image_meta', + @mock.patch('bareon.drivers.nailgun.Nailgun.parse_image_meta', return_value={}) @mock.patch.object(hu, 'list_block_devices') @mock.patch.object(fu, 'make_fs') @@ -429,9 +429,9 @@ class TestManager(unittest2.TestCase): mock.call('xfs', '', '', '/dev/mapper/image-glance')] self.assertEqual(mock_fu_mf_expected_calls, mock_fu_mf.call_args_list) - @mock.patch('fuel_agent.drivers.nailgun.Nailgun.parse_image_meta', + @mock.patch('bareon.drivers.nailgun.Nailgun.parse_image_meta', return_value={}) - @mock.patch('fuel_agent.drivers.nailgun.Nailgun.parse_operating_system') + @mock.patch('bareon.drivers.nailgun.Nailgun.parse_operating_system') @mock.patch.object(utils, 'calculate_md5') @mock.patch('os.path.getsize') @mock.patch('yaml.load') @@ -676,11 +676,11 @@ class TestManager(unittest2.TestCase): self.assertRaises(errors.ImageChecksumMismatchError, self.mgr.do_copyimage) - @mock.patch('fuel_agent.manager.fu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.fu', create=True) + @mock.patch('bareon.manager.utils', create=True) + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.os', create=True) + @mock.patch('bareon.manager.os', create=True) def test_mount_target_mtab_is_link(self, mock_os, mock_open, mock_utils, mock_fu): mock_os.path.islink.return_value = True @@ -692,11 +692,11 @@ class TestManager(unittest2.TestCase): mock_os.path.islink.assert_called_once_with('fake_chroot/etc/mtab') mock_os.remove.assert_called_once_with('fake_chroot/etc/mtab') - @mock.patch('fuel_agent.manager.fu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.fu', create=True) + @mock.patch('bareon.manager.utils', create=True) + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.os', create=True) + @mock.patch('bareon.manager.os', create=True) def test_mount_target(self, mock_os, mock_open, mock_utils, mock_fu): mock_os.path.islink.return_value = False self.mgr.driver._partition_scheme = objects.PartitionScheme() @@ -747,7 +747,7 @@ none /run/shm tmpfs rw,nosuid,nodev 0 0""" mock_os.path.islink.assert_called_once_with('fake_chroot/etc/mtab') self.assertFalse(mock_os.remove.called) - @mock.patch('fuel_agent.manager.fu', create=True) + @mock.patch('bareon.manager.fu', create=True) def test_umount_target(self, mock_fu): self.mgr.driver._partition_scheme = objects.PartitionScheme() self.mgr.driver.partition_scheme.add_fs( @@ -804,14 +804,14 @@ class TestImageBuild(unittest2.TestCase): self.mgr = manager.Manager(image_conf) @mock.patch.object(manager.Manager, '_set_apt_repos') - @mock.patch('fuel_agent.manager.bu', create=True) - @mock.patch('fuel_agent.manager.fu', create=True) - @mock.patch('fuel_agent.manager.utils', create=True) - @mock.patch('fuel_agent.manager.os', create=True) - @mock.patch('fuel_agent.manager.shutil.move') - @mock.patch('fuel_agent.manager.open', + @mock.patch('bareon.manager.bu', create=True) + @mock.patch('bareon.manager.fu', create=True) + @mock.patch('bareon.manager.utils', create=True) + @mock.patch('bareon.manager.os', create=True) + @mock.patch('bareon.manager.shutil.move') + @mock.patch('bareon.manager.open', create=True, new_callable=mock.mock_open) - @mock.patch('fuel_agent.manager.yaml.safe_dump') + @mock.patch('bareon.manager.yaml.safe_dump') @mock.patch.object(manager.Manager, 'mount_target') @mock.patch.object(manager.Manager, 'umount_target') def test_do_build_image(self, mock_umount_target, mock_mount_target, diff --git a/fuel_agent/tests/test_md_utils.py b/bareon/tests/test_md_utils.py similarity index 98% rename from fuel_agent/tests/test_md_utils.py rename to bareon/tests/test_md_utils.py index 08a4343..400c8c4 100644 --- a/fuel_agent/tests/test_md_utils.py +++ b/bareon/tests/test_md_utils.py @@ -15,10 +15,10 @@ import six import unittest2 -from fuel_agent import errors -from fuel_agent.utils import hardware as hu -from fuel_agent.utils import md as mu -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import hardware as hu +from bareon.utils import md as mu +from bareon.utils import utils if six.PY2: @@ -31,7 +31,7 @@ else: class TestMdUtils(unittest2.TestCase): - @mock.patch('fuel_agent.utils.md.utils.execute') + @mock.patch('bareon.utils.md.utils.execute') def test_mddisplay_nostate_detail(self, mock_exec): mock_exec.return_value = ( """/dev/md127: diff --git a/fuel_agent/tests/test_nailgun.py b/bareon/tests/test_nailgun.py similarity index 99% rename from fuel_agent/tests/test_nailgun.py rename to bareon/tests/test_nailgun.py index e4fcdb6..623c378 100644 --- a/fuel_agent/tests/test_nailgun.py +++ b/bareon/tests/test_nailgun.py @@ -19,11 +19,11 @@ import six import unittest2 import yaml -from fuel_agent.drivers import nailgun -from fuel_agent import errors -from fuel_agent import objects -from fuel_agent.objects import image -from fuel_agent.utils import utils +from bareon.drivers import nailgun +from bareon import errors +from bareon import objects +from bareon.objects import image +from bareon.utils import utils CEPH_JOURNAL = { @@ -932,7 +932,7 @@ class TestNailgunGetOSMethods(unittest2.TestCase): @mock.patch.object(nailgun.Nailgun, 'parse_image_meta', return_value={}) -@mock.patch('fuel_agent.drivers.nailgun.hu.list_block_devices') +@mock.patch('bareon.drivers.nailgun.hu.list_block_devices') class TestNailgunMockedMeta(unittest2.TestCase): def test_configdrive_scheme(self, mock_lbd, mock_image_meta): mock_lbd.return_value = LIST_BLOCK_DEVICES_SAMPLE @@ -1280,7 +1280,7 @@ class TestNailgunMockedMeta(unittest2.TestCase): @mock.patch.object(utils, 'init_http_request') -@mock.patch('fuel_agent.drivers.nailgun.hu.list_block_devices') +@mock.patch('bareon.drivers.nailgun.hu.list_block_devices') class TestNailgunImageMeta(unittest2.TestCase): def test_parse_image_meta(self, mock_lbd, mock_http_req): fake_image_meta = {'images': [{'raw_md5': 'fakeroot', 'raw_size': 1, diff --git a/fuel_agent/tests/test_nailgun_build_image.py b/bareon/tests/test_nailgun_build_image.py similarity index 91% rename from fuel_agent/tests/test_nailgun_build_image.py rename to bareon/tests/test_nailgun_build_image.py index ef78ecd..0e6cdff 100644 --- a/fuel_agent/tests/test_nailgun_build_image.py +++ b/bareon/tests/test_nailgun_build_image.py @@ -19,9 +19,9 @@ import six from six.moves.urllib.parse import urlsplit import unittest2 -from fuel_agent.drivers.nailgun import NailgunBuildImage -from fuel_agent import errors -from fuel_agent import objects +from bareon.drivers.nailgun import NailgunBuildImage +from bareon import errors +from bareon import objects DEFAULT_TRUSTY_PACKAGES = [ "acl", @@ -114,8 +114,8 @@ class TestNailgunBuildImage(unittest2.TestCase): data = {'codename': 'not-trusty'} NailgunBuildImage(data) - @mock.patch('fuel_agent.objects.RepoProxies') - @mock.patch('fuel_agent.objects.Ubuntu') + @mock.patch('bareon.objects.RepoProxies') + @mock.patch('bareon.objects.Ubuntu') @mock.patch.object(NailgunBuildImage, 'parse_schemes') def test_parse_operating_system_packages_given(self, mock_parse_schemes, mock_ub, mock_proxies): @@ -132,8 +132,8 @@ class TestNailgunBuildImage(unittest2.TestCase): proxies=mock_proxies.return_value) self.assertEqual(driver.operating_system.packages, data['packages']) - @mock.patch('fuel_agent.objects.RepoProxies') - @mock.patch('fuel_agent.objects.Ubuntu') + @mock.patch('bareon.objects.RepoProxies') + @mock.patch('bareon.objects.Ubuntu') @mock.patch.object(NailgunBuildImage, 'parse_schemes') def test_parse_operating_system_packages_not_given( self, mock_parse_schemes, mock_ub, mock_proxies): @@ -150,9 +150,9 @@ class TestNailgunBuildImage(unittest2.TestCase): self.assertEqual(driver.operating_system.packages, NailgunBuildImage.DEFAULT_TRUSTY_PACKAGES) - @mock.patch('fuel_agent.objects.RepoProxies') - @mock.patch('fuel_agent.objects.DEBRepo') - @mock.patch('fuel_agent.objects.Ubuntu') + @mock.patch('bareon.objects.RepoProxies') + @mock.patch('bareon.objects.DEBRepo') + @mock.patch('bareon.objects.Ubuntu') @mock.patch.object(NailgunBuildImage, 'parse_schemes') def test_parse_operating_system_repos(self, mock_parse_schemes, mock_ub, mock_deb, mock_proxies): @@ -183,11 +183,11 @@ class TestNailgunBuildImage(unittest2.TestCase): mock_deb.call_args_list[:len(REPOS_SAMPLE)]) self.assertEqual(driver.operating_system.repos, repos) - @mock.patch('fuel_agent.drivers.nailgun.objects.Loop') - @mock.patch('fuel_agent.objects.Image') - @mock.patch('fuel_agent.objects.FS') - @mock.patch('fuel_agent.objects.PartitionScheme') - @mock.patch('fuel_agent.objects.ImageScheme') + @mock.patch('bareon.drivers.nailgun.objects.Loop') + @mock.patch('bareon.objects.Image') + @mock.patch('bareon.objects.FS') + @mock.patch('bareon.objects.PartitionScheme') + @mock.patch('bareon.objects.ImageScheme') @mock.patch.object(NailgunBuildImage, 'parse_operating_system') def test_parse_schemes( self, mock_parse_os, mock_imgsch, mock_partsch, diff --git a/fuel_agent/tests/test_partition.py b/bareon/tests/test_partition.py similarity index 99% rename from fuel_agent/tests/test_partition.py rename to bareon/tests/test_partition.py index 4853a23..1565dd1 100644 --- a/fuel_agent/tests/test_partition.py +++ b/bareon/tests/test_partition.py @@ -15,8 +15,8 @@ import mock import unittest2 -from fuel_agent import errors -from fuel_agent import objects +from bareon import errors +from bareon import objects class TestMultipleDevice(unittest2.TestCase): diff --git a/fuel_agent/tests/test_partition_utils.py b/bareon/tests/test_partition_utils.py similarity index 99% rename from fuel_agent/tests/test_partition_utils.py rename to bareon/tests/test_partition_utils.py index 14e1890..6529d4c 100644 --- a/fuel_agent/tests/test_partition_utils.py +++ b/bareon/tests/test_partition_utils.py @@ -17,9 +17,9 @@ import time import mock import unittest2 -from fuel_agent import errors -from fuel_agent.utils import partition as pu -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import partition as pu +from bareon.utils import utils class TestPartitionUtils(unittest2.TestCase): diff --git a/fuel_agent/tests/test_requirements.py b/bareon/tests/test_requirements.py similarity index 96% rename from fuel_agent/tests/test_requirements.py rename to bareon/tests/test_requirements.py index 84aee74..34b6c5a 100644 --- a/fuel_agent/tests/test_requirements.py +++ b/bareon/tests/test_requirements.py @@ -18,4 +18,4 @@ from pkg_resources import require def test_check_requirements_conflicts(): - require('fuel_agent') + require('bareon') diff --git a/fuel_agent/tests/test_simple_nailgun_driver.py b/bareon/tests/test_simple_nailgun_driver.py similarity index 98% rename from fuel_agent/tests/test_simple_nailgun_driver.py rename to bareon/tests/test_simple_nailgun_driver.py index 511d776..23f49ce 100644 --- a/fuel_agent/tests/test_simple_nailgun_driver.py +++ b/bareon/tests/test_simple_nailgun_driver.py @@ -17,9 +17,9 @@ import mock import requests_mock import unittest2 -from fuel_agent.drivers import simple -from fuel_agent import objects -from fuel_agent.tests import base +from bareon.drivers import simple +from bareon import objects +from bareon.tests import base @mock.patch.multiple( diff --git a/fuel_agent/tests/test_utils.py b/bareon/tests/test_utils.py similarity index 96% rename from fuel_agent/tests/test_utils.py rename to bareon/tests/test_utils.py index cb221c8..d8e6ee7 100644 --- a/fuel_agent/tests/test_utils.py +++ b/bareon/tests/test_utils.py @@ -22,8 +22,8 @@ import stevedore import unittest2 import urllib3 -from fuel_agent import errors -from fuel_agent.utils import utils +from bareon import errors +from bareon.utils import utils if six.PY2: import mock @@ -96,8 +96,8 @@ class ExecuteTestCase(unittest2.TestCase): utils.execute, '/usr/bin/env', 'false', check_exit_code=True) - @mock.patch('fuel_agent.utils.utils.time.sleep') - @mock.patch('fuel_agent.utils.utils.subprocess.Popen') + @mock.patch('bareon.utils.utils.time.sleep') + @mock.patch('bareon.utils.utils.subprocess.Popen') def test_execute_ok_on_third_attempts(self, mock_popen, mock_sleep): process = mock.Mock() mock_popen.side_effect = [OSError, ValueError, process] @@ -107,8 +107,8 @@ class ExecuteTestCase(unittest2.TestCase): self.assertEqual(2 * [mock.call(CONF.execute_retry_delay)], mock_sleep.call_args_list) - @mock.patch('fuel_agent.utils.utils.time.sleep') - @mock.patch('fuel_agent.utils.utils.subprocess.Popen') + @mock.patch('bareon.utils.utils.time.sleep') + @mock.patch('bareon.utils.utils.subprocess.Popen') def test_execute_failed(self, mock_popen, mock_sleep): mock_popen.side_effect = OSError self.assertRaises(errors.ProcessExecutionError, utils.execute, @@ -199,44 +199,44 @@ class ExecuteTestCase(unittest2.TestCase): self.assertRaises(errors.HttpUrlConnectionError, utils.init_http_request, 'fake_url') - @mock.patch('fuel_agent.utils.utils.os.makedirs') - @mock.patch('fuel_agent.utils.utils.os.path.isdir', return_value=False) + @mock.patch('bareon.utils.utils.os.makedirs') + @mock.patch('bareon.utils.utils.os.path.isdir', return_value=False) def test_makedirs_if_not_exists(self, mock_isdir, mock_makedirs): utils.makedirs_if_not_exists('/fake/path') mock_isdir.assert_called_once_with('/fake/path') mock_makedirs.assert_called_once_with('/fake/path', mode=0o755) - @mock.patch('fuel_agent.utils.utils.os.makedirs') - @mock.patch('fuel_agent.utils.utils.os.path.isdir', return_value=False) + @mock.patch('bareon.utils.utils.os.makedirs') + @mock.patch('bareon.utils.utils.os.path.isdir', return_value=False) def test_makedirs_if_not_exists_mode_given( self, mock_isdir, mock_makedirs): utils.makedirs_if_not_exists('/fake/path', mode=0o000) mock_isdir.assert_called_once_with('/fake/path') mock_makedirs.assert_called_once_with('/fake/path', mode=0o000) - @mock.patch('fuel_agent.utils.utils.os.makedirs') - @mock.patch('fuel_agent.utils.utils.os.path.isdir', return_value=True) + @mock.patch('bareon.utils.utils.os.makedirs') + @mock.patch('bareon.utils.utils.os.path.isdir', return_value=True) def test_makedirs_if_not_exists_already_exists( self, mock_isdir, mock_makedirs): utils.makedirs_if_not_exists('/fake/path') mock_isdir.assert_called_once_with('/fake/path') self.assertEqual(mock_makedirs.mock_calls, []) - @mock.patch('fuel_agent.utils.utils.os.listdir') + @mock.patch('bareon.utils.utils.os.listdir') def test_guess_filename(self, mock_oslistdir): mock_oslistdir.return_value = ['file1', 'file2', 'file3'] filename = utils.guess_filename('/some/path', '^file2.*') self.assertEqual(filename, 'file2') mock_oslistdir.assert_called_once_with('/some/path') - @mock.patch('fuel_agent.utils.utils.os.listdir') + @mock.patch('bareon.utils.utils.os.listdir') def test_guess_filename_not_found(self, mock_oslistdir): mock_oslistdir.return_value = ['file1', 'file2', 'file3'] filename = utils.guess_filename('/some/path', '^file4.*') self.assertIsNone(filename) mock_oslistdir.assert_called_once_with('/some/path') - @mock.patch('fuel_agent.utils.utils.os.listdir') + @mock.patch('bareon.utils.utils.os.listdir') def test_guess_filename_not_exact_match(self, mock_oslistdir): mock_oslistdir.return_value = ['file1', 'file2', 'file3'] filename = utils.guess_filename('/some/path', '^file.*') @@ -244,7 +244,7 @@ class ExecuteTestCase(unittest2.TestCase): self.assertEqual(filename, 'file3') mock_oslistdir.assert_called_once_with('/some/path') - @mock.patch('fuel_agent.utils.utils.os.listdir') + @mock.patch('bareon.utils.utils.os.listdir') def test_guess_filename_not_exact_match_forward_sort(self, mock_oslistdir): mock_oslistdir.return_value = ['file1', 'file2', 'file3'] filename = utils.guess_filename('/some/path', '^file.*', reverse=False) diff --git a/fuel_agent/utils/__init__.py b/bareon/utils/__init__.py similarity index 100% rename from fuel_agent/utils/__init__.py rename to bareon/utils/__init__.py diff --git a/fuel_agent/utils/artifact.py b/bareon/utils/artifact.py similarity index 98% rename from fuel_agent/utils/artifact.py rename to bareon/utils/artifact.py index 56c5fed..d65168d 100644 --- a/fuel_agent/utils/artifact.py +++ b/bareon/utils/artifact.py @@ -21,9 +21,9 @@ import zlib from oslo_config import cfg import six -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import utils LOG = logging.getLogger(__name__) diff --git a/fuel_agent/utils/build.py b/bareon/utils/build.py similarity index 98% rename from fuel_agent/utils/build.py rename to bareon/utils/build.py index a7bf7b3..5447c31 100644 --- a/fuel_agent/utils/build.py +++ b/bareon/utils/build.py @@ -28,11 +28,11 @@ import signal import six import yaml -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import fs as fu -from fuel_agent.utils import hardware as hu -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import fs as fu +from bareon.utils import hardware as hu +from bareon.utils import utils LOG = logging.getLogger(__name__) @@ -49,9 +49,9 @@ DEFAULT_APT_PATH = { # FIXME(azvyagintsev): Move to oslo_config # Bug: https://bugs.launchpad.net/fuel/+bug/1514772 PROXY_PROTOCOLS = { - 'ftp': '01fuel_agent-use-proxy-ftp', - 'http': '01fuel_agent-use-proxy-http', - 'https': '01fuel_agent-use-proxy-https' + 'ftp': '01bareon-use-proxy-ftp', + 'http': '01bareon-use-proxy-http', + 'https': '01bareon-use-proxy-https' } # NOTE(agordeev): hardcoded to r00tme ROOT_PASSWORD = '$6$IInX3Cqo$5xytL1VZbZTusOewFnG6couuF0Ia61yS3rbC6P5YbZP2TYcl'\ @@ -187,7 +187,7 @@ def do_post_inst(chroot, allow_unsigned_file='allow_unsigned_packages', # Being enabled by default, sometimes it leads to puppet service hanging # and recognizing the deployment as failed. # TODO(agordeev): take care of puppet service for other distros, once - # fuel-agent will be capable of building images for them too. + # bareon will be capable of building images for them too. if os.path.exists(os.path.join(chroot, 'etc/init.d/puppet')): utils.execute('chroot', chroot, 'update-rc.d', 'puppet', 'disable') # NOTE(agordeev): disable mcollective to be automatically started on boot diff --git a/fuel_agent/utils/decorators.py b/bareon/utils/decorators.py similarity index 100% rename from fuel_agent/utils/decorators.py rename to bareon/utils/decorators.py diff --git a/fuel_agent/utils/fs.py b/bareon/utils/fs.py similarity index 96% rename from fuel_agent/utils/fs.py rename to bareon/utils/fs.py index e0d560a..47bf4c7 100644 --- a/fuel_agent/utils/fs.py +++ b/bareon/utils/fs.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import utils LOG = logging.getLogger(__name__) diff --git a/fuel_agent/utils/grub.py b/bareon/utils/grub.py similarity index 98% rename from fuel_agent/utils/grub.py rename to bareon/utils/grub.py index 9746cd8..195b0a1 100644 --- a/fuel_agent/utils/grub.py +++ b/bareon/utils/grub.py @@ -19,9 +19,9 @@ import shutil import six -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import utils LOG = logging.getLogger(__name__) diff --git a/fuel_agent/utils/hardware.py b/bareon/utils/hardware.py similarity index 97% rename from fuel_agent/utils/hardware.py rename to bareon/utils/hardware.py index c2a2f78..52735fb 100644 --- a/fuel_agent/utils/hardware.py +++ b/bareon/utils/hardware.py @@ -15,9 +15,9 @@ import os import stat -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import utils LOG = logging.getLogger(__name__) @@ -266,7 +266,7 @@ def get_block_devices_from_udev_db(): major = int(line.split()[1].split('=')[1]) if major not in VALID_MAJORS: # NOTE(agordeev): filter out cd/dvd drives and other - # block devices in which fuel-agent aren't interested + # block devices in which bareon aren't interested break if line.startswith('E: DEVNAME='): d = line.split()[1].split('=')[1] @@ -293,7 +293,7 @@ def list_block_devices(disks=True): # - don't use HDIO_GETGEO [Phillip Susi] # Since the bug only affects '--report' it is safe to use # 'blockdevreport'. - # fuel-agent has to be switched to use udev database in order to + # bareon has to be switched to use udev database in order to # find all block devices recognized by kernel. devs = get_block_devices_from_udev_db() for device in devs: @@ -315,7 +315,7 @@ def list_block_devices(disks=True): 'device': device, # NOTE(agordeev): blockdev gets 'startsec' from sysfs, # 'size' is determined by ioctl call. - # This data was not actually used by fuel-agent, + # This data was not actually used by bareon, # so it can be removed without side effects. 'uspec': uspec, 'bspec': bspec, diff --git a/fuel_agent/utils/lvm.py b/bareon/utils/lvm.py similarity index 97% rename from fuel_agent/utils/lvm.py rename to bareon/utils/lvm.py index 7beab6d..1e0ebbe 100644 --- a/fuel_agent/utils/lvm.py +++ b/bareon/utils/lvm.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import utils LOG = logging.getLogger(__name__) @@ -219,7 +219,7 @@ def lvcreate(vgname, lvname, size): # user's confirmation: # "WARNING: signature detected on . Wipe it? [y/n]" # FIXME: the version of lvm2 shipped with Ubuntu 14.04 does not support - # --yes option. fuel-agent should properly decomission the storage + # --yes option. bareon should properly decomission the storage # (Ubuntu installer does that just fine). stdout, stderr = utils.execute('lvcreate', '--help') force_opt = '--yes' if '--yes' in stdout else '' diff --git a/fuel_agent/utils/md.py b/bareon/utils/md.py similarity index 97% rename from fuel_agent/utils/md.py rename to bareon/utils/md.py index 038eb65..3334f96 100644 --- a/fuel_agent/utils/md.py +++ b/bareon/utils/md.py @@ -15,10 +15,10 @@ import itertools import re -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import hardware as hu -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import hardware as hu +from bareon.utils import utils LOG = logging.getLogger(__name__) diff --git a/fuel_agent/utils/partition.py b/bareon/utils/partition.py similarity index 98% rename from fuel_agent/utils/partition.py rename to bareon/utils/partition.py index acdd0b3..0d11abf 100644 --- a/fuel_agent/utils/partition.py +++ b/bareon/utils/partition.py @@ -14,9 +14,9 @@ import time -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging -from fuel_agent.utils import utils +from bareon import errors +from bareon.openstack.common import log as logging +from bareon.utils import utils LOG = logging.getLogger(__name__) diff --git a/fuel_agent/utils/utils.py b/bareon/utils/utils.py similarity index 97% rename from fuel_agent/utils/utils.py rename to bareon/utils/utils.py index fb77b1b..9446b24 100644 --- a/fuel_agent/utils/utils.py +++ b/bareon/utils/utils.py @@ -31,8 +31,8 @@ import stevedore.driver import urllib3 -from fuel_agent import errors -from fuel_agent.openstack.common import log as logging +from bareon import errors +from bareon.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -45,7 +45,7 @@ u_opts = [ ), cfg.FloatOpt( 'http_request_timeout', - # Setting it to 10 secs will allow fuel-agent to overcome the momentary + # Setting it to 10 secs will allow bareon to overcome the momentary # peak loads when network bandwidth becomes as low as 0.1MiB/s, thus # preventing of wasting too much retries on such false positives. default=10.0, @@ -163,9 +163,9 @@ def B2MiB(b, ceil=True): def get_driver(name): - LOG.debug('Trying to get driver: fuel_agent.drivers.%s', name) + LOG.debug('Trying to get driver: bareon.drivers.%s', name) driver = stevedore.driver.DriverManager( - namespace='fuel_agent.drivers', name=name).driver + namespace='bareon.drivers', name=name).driver LOG.debug('Found driver: %s', driver.__name__) return driver diff --git a/fuel_agent/version.py b/bareon/version.py similarity index 91% rename from fuel_agent/version.py rename to bareon/version.py index 5715f24..579ab60 100644 --- a/fuel_agent/version.py +++ b/bareon/version.py @@ -14,4 +14,4 @@ import pbr.version -version_info = pbr.version.VersionInfo('fuel-agent') +version_info = pbr.version.VersionInfo('bareon') diff --git a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py index 4e8e0ef..582f9b4 100644 --- a/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py +++ b/contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap/utils/bootstrap_image.py @@ -21,7 +21,7 @@ import tarfile import tempfile import yaml -from fuel_agent.utils import utils +from bareon.utils import utils from fuel_bootstrap import consts from fuel_bootstrap import errors diff --git a/etc/fuel-agent/fuel-agent.conf.sample b/etc/bareon/bareon.conf.sample similarity index 93% rename from etc/fuel-agent/fuel-agent.conf.sample rename to etc/bareon/bareon.conf.sample index 7bfb594..f60e1ac 100644 --- a/etc/fuel-agent/fuel-agent.conf.sample +++ b/etc/bareon/bareon.conf.sample @@ -1,7 +1,7 @@ [DEFAULT] # -# Options defined in fuel_agent.manager +# Options defined in bareon.manager # # Data driver (string value) @@ -12,7 +12,7 @@ #image_build_dir=/tmp # Path to directory with cloud init templates (string value) -#nc_template_path=/usr/share/fuel-agent/cloud-init-templates +#nc_template_path=/usr/share/bareon/cloud-init-templates # Temporary directory for file manipulations (string value) #tmp_path=/tmp @@ -38,7 +38,7 @@ # Suffix which is used while creating temporary files (string # value) -#image_build_suffix=.fuel-agent-image +#image_build_suffix=.bareon-image # Timeout in secs for GRUB (integer value) #grub_timeout=5 @@ -73,7 +73,7 @@ # -# Options defined in fuel_agent.cmd.agent +# Options defined in bareon.cmd.agent # # Input data file (string value) @@ -84,7 +84,7 @@ # -# Options defined in fuel_agent.openstack.common.log +# Options defined in bareon.openstack.common.log # # Print debugging output (set logging level to DEBUG instead @@ -154,7 +154,7 @@ logging_debug_format_suffix= # (Optional) Name of log file to output to. If no default is # set, logging will go to stdout. (string value) # Deprecated group/name - [DEFAULT]/logfile -log_file=/var/log/fuel-agent.log +log_file=/var/log/bareon.log # (Optional) The base directory used for relative --log-file # paths. (string value) @@ -178,7 +178,7 @@ log_file=/var/log/fuel-agent.log # -# Options defined in fuel_agent.utils.artifact +# Options defined in bareon.utils.artifact # # Size of data chunk to operate with images (integer value) @@ -186,7 +186,7 @@ log_file=/var/log/fuel-agent.log # -# Options defined in fuel_agent.utils.utils +# Options defined in bareon.utils.utils # # Maximum retries count for http requests. 0 means infinite diff --git a/fuel_agent/objects/__init__.py b/fuel_agent/objects/__init__.py deleted file mode 100644 index f15097a..0000000 --- a/fuel_agent/objects/__init__.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2014 Mirantis, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from fuel_agent.objects.bootloader import Grub -from fuel_agent.objects.configdrive import ConfigDriveCommon -from fuel_agent.objects.configdrive import ConfigDriveMcollective -from fuel_agent.objects.configdrive import ConfigDrivePuppet -from fuel_agent.objects.configdrive import ConfigDriveScheme -from fuel_agent.objects.device import Loop -from fuel_agent.objects.image import Image -from fuel_agent.objects.image import ImageScheme -from fuel_agent.objects.operating_system import Centos -from fuel_agent.objects.operating_system import OperatingSystem -from fuel_agent.objects.operating_system import Ubuntu -from fuel_agent.objects.partition.fs import FileSystem -from fuel_agent.objects.partition.lv import LogicalVolume -from fuel_agent.objects.partition.md import MultipleDevice -from fuel_agent.objects.partition.parted import Parted -from fuel_agent.objects.partition.parted import Partition -from fuel_agent.objects.partition.pv import PhysicalVolume -from fuel_agent.objects.partition.scheme import PartitionScheme -from fuel_agent.objects.partition.vg import VolumeGroup -from fuel_agent.objects.repo import DEBRepo -from fuel_agent.objects.repo import Repo -from fuel_agent.objects.repo import RepoProxies - - -PV = PhysicalVolume -VG = VolumeGroup -LV = LogicalVolume -MD = MultipleDevice -FS = FileSystem - - -__all__ = [ - 'Partition', - 'Parted', - 'PhysicalVolume', - 'PV', - 'VolumeGroup', - 'VG', - 'LogicalVolume', - 'LV', - 'MultipleDevice', - 'MD', - 'FileSystem', - 'FS', - 'PartitionScheme', - 'ConfigDriveCommon', - 'ConfigDrivePuppet', - 'ConfigDriveMcollective', - 'ConfigDriveScheme', - 'Image', - 'ImageScheme', - 'Grub', - 'OperatingSystem', - 'Ubuntu', - 'Centos', - 'Repo', - 'DEBRepo', - 'Loop', - 'RepoProxies' -] diff --git a/openstack-common.conf b/openstack-common.conf index 5a67e06..ccef55b 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -7,4 +7,4 @@ module=log module=processutils # The base module to hold the copy of openstack.common -base=fuel_agent \ No newline at end of file +base=bareon \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index 4cc46b4..923a8f4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,35 +1,35 @@ [metadata] -name = fuel-agent -version = 8.0.0 +name = bareon +version = 1.0.0.dev author = Mirantis -author-email = fuel-dev@lists.launchpad.net -summary = Fuel agent +author-email = openstack-dev@lists.openstack.org +summary = Bareon classifier = Development Status :: 4 - Beta Programming Language :: Python [files] packages = - fuel_agent + bareon [entry_points] console_scripts = # TODO(kozhukalov): rename entry point - provision = fuel_agent.cmd.agent:provision - fa_partition = fuel_agent.cmd.agent:partition - fa_configdrive = fuel_agent.cmd.agent:configdrive - fa_copyimage = fuel_agent.cmd.agent:copyimage - fa_bootloader = fuel_agent.cmd.agent:bootloader - fa_build_image = fuel_agent.cmd.agent:build_image - fa_ironic_callback = fuel_agent.cmd.ironic_callback:main - fa_mkbootstrap = fuel_agent.cmd.agent:mkbootstrap + provision = bareon.cmd.agent:provision + fa_partition = bareon.cmd.agent:partition + fa_configdrive = bareon.cmd.agent:configdrive + fa_copyimage = bareon.cmd.agent:copyimage + fa_bootloader = bareon.cmd.agent:bootloader + fa_build_image = bareon.cmd.agent:build_image + fa_ironic_callback = bareon.cmd.ironic_callback:main + fa_mkbootstrap = bareon.cmd.agent:mkbootstrap -fuel_agent.drivers = - nailgun = fuel_agent.drivers.nailgun:Nailgun - nailgun_simple = fuel_agent.drivers.simple:NailgunSimpleDriver - nailgun_build_image = fuel_agent.drivers.nailgun:NailgunBuildImage - ironic = fuel_agent.drivers.nailgun:Ironic - bootstrap_build_image = fuel_agent.drivers.bootstrap:BootstrapBuildImage +bareon.drivers = + nailgun = bareon.drivers.nailgun:Nailgun + nailgun_simple = bareon.drivers.simple:NailgunSimpleDriver + nailgun_build_image = bareon.drivers.nailgun:NailgunBuildImage + ironic = bareon.drivers.nailgun:Ironic + bootstrap_build_image = bareon.drivers.bootstrap:BootstrapBuildImage [pbr] autodoc_index_modules = True @@ -40,7 +40,7 @@ skip_git_sdist = True [global] setup-hooks = pbr.hooks.setup_hook - fuel_agent.hooks.setup_hook + bareon.hooks.setup_hook [build_sphinx] all_files = 1 diff --git a/tools/config/check_uptodate.sh b/tools/config/check_uptodate.sh index 14f68cc..8e65531 100755 --- a/tools/config/check_uptodate.sh +++ b/tools/config/check_uptodate.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -PROJECT_NAME=${PROJECT_NAME:-fuel_agent} +PROJECT_NAME=${PROJECT_NAME:-bareon} CFGFILE_NAME=${PROJECT_NAME}.conf.sample if [ -e etc/${PROJECT_NAME}/${CFGFILE_NAME} ]; then diff --git a/tools/config/generate_sample.sh b/tools/config/generate_sample.sh index 02a2828..ce3e1d6 100755 --- a/tools/config/generate_sample.sh +++ b/tools/config/generate_sample.sh @@ -114,7 +114,7 @@ export EVENTLET_NO_GREENDNS=yes OS_VARS=$(set | sed -n '/^OS_/s/=[^=]*$//gp' | xargs) [ "$OS_VARS" ] && eval "unset \$OS_VARS" -DEFAULT_MODULEPATH=fuel_agent.openstack.common.config.generator +DEFAULT_MODULEPATH=bareon.openstack.common.config.generator MODULEPATH=${MODULEPATH:-$DEFAULT_MODULEPATH} OUTPUTFILE=${OUTPUTFILE:-$OUTPUTDIR/$PACKAGENAME.conf.sample} python -m $MODULEPATH $MODULES $LIBRARIES $FILES > $OUTPUTFILE diff --git a/tox.ini b/tox.ini index d1fe5a2..75e50ce 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - py.test -vv {posargs:fuel_agent/tests} + py.test -vv {posargs:bareon/tests} [tox:jenkins] downloadcache = ~/cache/pip @@ -18,13 +18,13 @@ downloadcache = ~/cache/pip [testenv:pep8] deps = hacking==0.10.2 commands = - flake8 {posargs:fuel_agent} + flake8 {posargs:bareon} flake8 {posargs:contrib/fuel_bootstrap/fuel_bootstrap_cli/fuel_bootstrap} [testenv:cover] setenv = VIRTUAL_ENV={envdir} commands = - py.test --cov fuel_agent {posargs:fuel_agent/tests} + py.test --cov bareon {posargs:bareon/tests} [testenv:venv] commands = {posargs:} @@ -43,4 +43,4 @@ show-source = True count = True [hacking] -import_exceptions = fuel_agent.openstack.common.gettextutils._,testtools.matchers +import_exceptions = bareon.openstack.common.gettextutils._,testtools.matchers