Rename all "utils/*_utils.py"
NAME_utils.py was completely redundant and caused confusion so it was renamed to just utils/NAME.py Change-Id: Ifd9178772cca385f687ac9806e6043cfbf27813e Implements: blueprint volume-manager-refactoring
This commit is contained in:
parent
e2697c1b1d
commit
bdb6594b7a
@ -143,7 +143,7 @@ log_file=/var/log/fuel-agent.log
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Options defined in fuel_agent.utils.artifact_utils
|
# Options defined in fuel_agent.utils.artifact
|
||||||
#
|
#
|
||||||
|
|
||||||
# Size of data chunk to operate with images (integer value)
|
# Size of data chunk to operate with images (integer value)
|
||||||
@ -151,7 +151,7 @@ log_file=/var/log/fuel-agent.log
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Options defined in fuel_agent.utils.build_utils
|
# Options defined in fuel_agent.utils.build
|
||||||
#
|
#
|
||||||
|
|
||||||
# Maximum allowed loop devices count to use (integer value)
|
# Maximum allowed loop devices count to use (integer value)
|
||||||
|
@ -27,7 +27,7 @@ from fuel_agent.drivers import ks_spaces_validator
|
|||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent import objects
|
from fuel_agent import objects
|
||||||
from fuel_agent.openstack.common import log as logging
|
from fuel_agent.openstack.common import log as logging
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,13 +22,13 @@ from oslo.config import cfg
|
|||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.openstack.common import log as logging
|
from fuel_agent.openstack.common import log as logging
|
||||||
from fuel_agent.utils import artifact_utils as au
|
from fuel_agent.utils import artifact as au
|
||||||
from fuel_agent.utils import build_utils as bu
|
from fuel_agent.utils import build as bu
|
||||||
from fuel_agent.utils import fs_utils as fu
|
from fuel_agent.utils import fs as fu
|
||||||
from fuel_agent.utils import grub_utils as gu
|
from fuel_agent.utils import grub as gu
|
||||||
from fuel_agent.utils import lvm_utils as lu
|
from fuel_agent.utils import lvm as lu
|
||||||
from fuel_agent.utils import md_utils as mu
|
from fuel_agent.utils import md as mu
|
||||||
from fuel_agent.utils import partition_utils as pu
|
from fuel_agent.utils import partition as pu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
opts = [
|
opts = [
|
||||||
|
@ -19,7 +19,7 @@ import zlib
|
|||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.utils import artifact_utils as au
|
from fuel_agent.utils import artifact as au
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ import mock
|
|||||||
from oslo.config import cfg
|
from oslo.config import cfg
|
||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.utils import build_utils as bu
|
from fuel_agent.utils import build as bu
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ class BuildUtilsTestCase(testtools.TestCase):
|
|||||||
'etc/apt/apt.conf.d/%s' % 'force_ipv4',
|
'etc/apt/apt.conf.d/%s' % 'force_ipv4',
|
||||||
'etc/apt/apt.conf.d/%s' % 'unsigned'])
|
'etc/apt/apt.conf.d/%s' % 'unsigned'])
|
||||||
|
|
||||||
@mock.patch('fuel_agent.utils.build_utils.open',
|
@mock.patch('fuel_agent.utils.build.open',
|
||||||
create=True, new_callable=mock.mock_open)
|
create=True, new_callable=mock.mock_open)
|
||||||
@mock.patch.object(os, 'path')
|
@mock.patch.object(os, 'path')
|
||||||
@mock.patch.object(bu, 'clean_apt_settings')
|
@mock.patch.object(bu, 'clean_apt_settings')
|
||||||
@ -186,9 +186,9 @@ class BuildUtilsTestCase(testtools.TestCase):
|
|||||||
self.assertEqual(mock_path_join_expected_calls,
|
self.assertEqual(mock_path_join_expected_calls,
|
||||||
mock_path.join.call_args_list)
|
mock_path.join.call_args_list)
|
||||||
|
|
||||||
@mock.patch('fuel_agent.utils.build_utils.open',
|
@mock.patch('fuel_agent.utils.build.open',
|
||||||
create=True, new_callable=mock.mock_open)
|
create=True, new_callable=mock.mock_open)
|
||||||
@mock.patch('fuel_agent.utils.build_utils.time.sleep')
|
@mock.patch('fuel_agent.utils.build.time.sleep')
|
||||||
@mock.patch.object(os, 'kill')
|
@mock.patch.object(os, 'kill')
|
||||||
@mock.patch.object(os, 'readlink', return_value='chroot')
|
@mock.patch.object(os, 'readlink', return_value='chroot')
|
||||||
@mock.patch.object(utils, 'execute')
|
@mock.patch.object(utils, 'execute')
|
||||||
@ -333,7 +333,7 @@ class BuildUtilsTestCase(testtools.TestCase):
|
|||||||
mock_path.join.call_args_list)
|
mock_path.join.call_args_list)
|
||||||
|
|
||||||
@mock.patch.object(os, 'path')
|
@mock.patch.object(os, 'path')
|
||||||
@mock.patch('fuel_agent.utils.build_utils.utils.init_http_request',
|
@mock.patch('fuel_agent.utils.build.utils.init_http_request',
|
||||||
return_value=mock.Mock(text=_fake_ubuntu_release))
|
return_value=mock.Mock(text=_fake_ubuntu_release))
|
||||||
def test_add_apt_preference(self, mock_get, mock_path):
|
def test_add_apt_preference(self, mock_get, mock_path):
|
||||||
with mock.patch('six.moves.builtins.open', create=True) as mock_open:
|
with mock.patch('six.moves.builtins.open', create=True) as mock_open:
|
||||||
@ -371,7 +371,7 @@ class BuildUtilsTestCase(testtools.TestCase):
|
|||||||
mock_path.join.call_args_list)
|
mock_path.join.call_args_list)
|
||||||
|
|
||||||
@mock.patch.object(os, 'path')
|
@mock.patch.object(os, 'path')
|
||||||
@mock.patch('fuel_agent.utils.build_utils.utils.init_http_request',
|
@mock.patch('fuel_agent.utils.build.utils.init_http_request',
|
||||||
return_value=mock.Mock(text=_fake_ubuntu_release))
|
return_value=mock.Mock(text=_fake_ubuntu_release))
|
||||||
def test_add_apt_preference_multuple_sections(self, mock_get, mock_path):
|
def test_add_apt_preference_multuple_sections(self, mock_get, mock_path):
|
||||||
with mock.patch('six.moves.builtins.open', create=True) as mock_open:
|
with mock.patch('six.moves.builtins.open', create=True) as mock_open:
|
||||||
@ -414,7 +414,7 @@ class BuildUtilsTestCase(testtools.TestCase):
|
|||||||
mock_path.join.call_args_list)
|
mock_path.join.call_args_list)
|
||||||
|
|
||||||
@mock.patch.object(os, 'path')
|
@mock.patch.object(os, 'path')
|
||||||
@mock.patch('fuel_agent.utils.build_utils.utils.init_http_request',
|
@mock.patch('fuel_agent.utils.build.utils.init_http_request',
|
||||||
return_value=mock.Mock(text=_fake_ubuntu_release))
|
return_value=mock.Mock(text=_fake_ubuntu_release))
|
||||||
def test_add_apt_preference_no_sections(self, mock_get, mock_path):
|
def test_add_apt_preference_no_sections(self, mock_get, mock_path):
|
||||||
with mock.patch('six.moves.builtins.open', create=True) as mock_open:
|
with mock.patch('six.moves.builtins.open', create=True) as mock_open:
|
||||||
|
@ -16,7 +16,7 @@ import mock
|
|||||||
from oslotest import base as test_base
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.utils import fs_utils as fu
|
from fuel_agent.utils import fs as fu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ else:
|
|||||||
OPEN_FUNCTION_NAME = 'builtins.open'
|
OPEN_FUNCTION_NAME = 'builtins.open'
|
||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.utils import grub_utils as gu
|
from fuel_agent.utils import grub as gu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
@ -205,7 +205,7 @@ class TestGrubUtils(test_base.BaseTestCase):
|
|||||||
self.assertEqual(gu.guess_grub_install('/target'),
|
self.assertEqual(gu.guess_grub_install('/target'),
|
||||||
'/usr/sbin/grub2-install')
|
'/usr/sbin/grub2-install')
|
||||||
|
|
||||||
@mock.patch('fuel_agent.utils.grub_utils.utils.guess_filename')
|
@mock.patch('fuel_agent.utils.grub.utils.guess_filename')
|
||||||
def test_guess_kernel(self, mock_guess):
|
def test_guess_kernel(self, mock_guess):
|
||||||
mock_guess.return_value = 'vmlinuz-version'
|
mock_guess.return_value = 'vmlinuz-version'
|
||||||
self.assertEqual(gu.guess_kernel('/target'), 'vmlinuz-version')
|
self.assertEqual(gu.guess_kernel('/target'), 'vmlinuz-version')
|
||||||
@ -223,7 +223,7 @@ class TestGrubUtils(test_base.BaseTestCase):
|
|||||||
mock_guess.return_value = None
|
mock_guess.return_value = None
|
||||||
self.assertRaises(errors.GrubUtilsError, gu.guess_kernel, '/target')
|
self.assertRaises(errors.GrubUtilsError, gu.guess_kernel, '/target')
|
||||||
|
|
||||||
@mock.patch('fuel_agent.utils.grub_utils.utils.guess_filename')
|
@mock.patch('fuel_agent.utils.grub.utils.guess_filename')
|
||||||
def test_guess_initrd(self, mock_guess):
|
def test_guess_initrd(self, mock_guess):
|
||||||
mock_guess.return_value = 'initrd-version'
|
mock_guess.return_value = 'initrd-version'
|
||||||
self.assertEqual(gu.guess_initrd('/target'), 'initrd-version')
|
self.assertEqual(gu.guess_initrd('/target'), 'initrd-version')
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
import mock
|
import mock
|
||||||
from oslotest import base as test_base
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
@ -280,7 +280,7 @@ supports-register-dump: yes
|
|||||||
}
|
}
|
||||||
self.assertFalse(hu.is_disk('/dev/fake', bspec=bspec))
|
self.assertFalse(hu.is_disk('/dev/fake', bspec=bspec))
|
||||||
|
|
||||||
@mock.patch('fuel_agent.utils.hardware_utils.utils.execute')
|
@mock.patch('fuel_agent.utils.hardware.utils.execute')
|
||||||
def test_get_block_devices_from_udev_db(self, mock_exec):
|
def test_get_block_devices_from_udev_db(self, mock_exec):
|
||||||
mock_exec.return_value = ("""P: /devices/virtual/block/loop0
|
mock_exec.return_value = ("""P: /devices/virtual/block/loop0
|
||||||
N: loop0
|
N: loop0
|
||||||
|
@ -16,7 +16,7 @@ import mock
|
|||||||
from oslotest import base as test_base
|
from oslotest import base as test_base
|
||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.utils import lvm_utils as lu
|
from fuel_agent.utils import lvm as lu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,12 +24,12 @@ from fuel_agent import manager
|
|||||||
from fuel_agent import objects
|
from fuel_agent import objects
|
||||||
from fuel_agent.objects import partition
|
from fuel_agent.objects import partition
|
||||||
from fuel_agent.tests import test_nailgun
|
from fuel_agent.tests import test_nailgun
|
||||||
from fuel_agent.utils import artifact_utils as au
|
from fuel_agent.utils import artifact as au
|
||||||
from fuel_agent.utils import fs_utils as fu
|
from fuel_agent.utils import fs as fu
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import lvm_utils as lu
|
from fuel_agent.utils import lvm as lu
|
||||||
from fuel_agent.utils import md_utils as mu
|
from fuel_agent.utils import md as mu
|
||||||
from fuel_agent.utils import partition_utils as pu
|
from fuel_agent.utils import partition as pu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
CONF = cfg.CONF
|
CONF = cfg.CONF
|
||||||
|
@ -17,8 +17,8 @@ from oslotest import base as test_base
|
|||||||
import six
|
import six
|
||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import md_utils as mu
|
from fuel_agent.utils import md as mu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ else:
|
|||||||
|
|
||||||
class TestMdUtils(test_base.BaseTestCase):
|
class TestMdUtils(test_base.BaseTestCase):
|
||||||
|
|
||||||
@mock.patch('fuel_agent.utils.md_utils.utils.execute')
|
@mock.patch('fuel_agent.utils.md.utils.execute')
|
||||||
def test_mddisplay_nostate_detail(self, mock_exec):
|
def test_mddisplay_nostate_detail(self, mock_exec):
|
||||||
mock_exec.return_value = (
|
mock_exec.return_value = (
|
||||||
"""/dev/md127:
|
"""/dev/md127:
|
||||||
|
@ -21,7 +21,7 @@ import yaml
|
|||||||
from fuel_agent.drivers import nailgun
|
from fuel_agent.drivers import nailgun
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.objects import image
|
from fuel_agent.objects import image
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ from oslotest import base as test_base
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.utils import partition_utils as pu
|
from fuel_agent.utils import partition as pu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ from oslo.config import cfg
|
|||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.openstack.common import log as logging
|
from fuel_agent.openstack.common import log as logging
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
@ -16,7 +16,7 @@ import re
|
|||||||
|
|
||||||
from fuel_agent import errors
|
from fuel_agent import errors
|
||||||
from fuel_agent.openstack.common import log as logging
|
from fuel_agent.openstack.common import log as logging
|
||||||
from fuel_agent.utils import hardware_utils as hu
|
from fuel_agent.utils import hardware as hu
|
||||||
from fuel_agent.utils import utils
|
from fuel_agent.utils import utils
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
Loading…
Reference in New Issue
Block a user