Browse Source

Merge "Uncap hacking"

tags/2.34.0
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
991586c20a
10 changed files with 36 additions and 32 deletions
  1. +1
    -0
      diskimage_builder/block_device/cmd.py
  2. +26
    -26
      diskimage_builder/block_device/config.py
  3. +2
    -2
      diskimage_builder/block_device/tests/test_lvm.py
  4. +1
    -1
      diskimage_builder/block_device/utils.py
  5. +1
    -0
      diskimage_builder/element_dependencies.py
  6. +1
    -0
      diskimage_builder/elements/package-installs/bin/package-installs-squash
  7. +1
    -0
      diskimage_builder/elements/pkg-map/bin/pkg-map
  8. +1
    -1
      diskimage_builder/tests/test_elementdeps.py
  9. +1
    -1
      requirements.txt
  10. +1
    -1
      tox.ini

+ 1
- 0
diskimage_builder/block_device/cmd.py View File

@@ -119,5 +119,6 @@ def main():
bdc = BlockDeviceCmd()
return bdc.main()


if __name__ == "__main__":
sys.exit(main())

+ 26
- 26
diskimage_builder/block_device/config.py View File

@@ -52,9 +52,9 @@ def recurse_config(config, parent_base=None):

# We should only have one key, with multiple values, being the
# config entries. e.g. (this was checked by config_tree_to_graph)
# mkfs:
# type: ext4
# label: 1234
# # mkfs:
# # type: ext4
# # label: 1234
assert len(config.items()) == 1
for k, v in config.items():
key = k
@@ -248,31 +248,31 @@ def create_graph(config, default_config, state):
#
# To be concrete --
#
# partitioning:
# base: loop0
# name: mbr
# partitions:
# - name: partition1
# foo: bar
# mkfs:
# type: xfs
# mount:
# mount_point: /
# # partitioning:
# # base: loop0
# # name: mbr
# # partitions:
# # - name: partition1
# # foo: bar
# # mkfs:
# # type: xfs
# # mount:
# # mount_point: /
#
# gets turned into the following graph:
#
# partitioning:
# partitions:
# - name: partition1
# base: image0
# foo: bar
# # partitioning:
# # partitions:
# # - name: partition1
# # base: image0
# # foo: bar
#
# mkfs:
# base: partition1
# name: mkfs_partition1
# type: xfs
# # mkfs:
# # base: partition1
# # name: mkfs_partition1
# # type: xfs
#
# mount:
# base: mkfs_partition1
# name: mount_mkfs_partition1
# mount_point: /
# # mount:
# # base: mkfs_partition1
# # name: mount_mkfs_partition1
# # mount_point: /

+ 2
- 2
diskimage_builder/block_device/tests/test_lvm.py View File

@@ -55,8 +55,8 @@ class TestLVM(tc.TestGraphGeneration):
bad_config = copy.deepcopy(lvm_config)
bad_config['lvs'][0]['base'] = ['invalid_vg']
self.assertRaisesRegex(BlockDeviceSetupException,
"base:\['invalid_vg'\] in lvs does not match "
"a valid vg",
r"base:\['invalid_vg'\] in lvs does not match "
r"a valid vg",
LVMPlugin, bad_config, {}, {})

bad_config = copy.deepcopy(lvm_config)


+ 1
- 1
diskimage_builder/block_device/utils.py View File

@@ -42,7 +42,7 @@ SIZE_UNIT_SPECS = [

# Basic RE to check and split floats (without exponent)
# and a given unit specification (which must be non-numerical).
size_unit_spec_re = re.compile("^([\d\.]*) ?([a-zA-Z0-9_]*)$")
size_unit_spec_re = re.compile(r"^([\d\.]*) ?([a-zA-Z0-9_]*)$")


def _split_size_unit_spec(size_unit_spec):


+ 1
- 0
diskimage_builder/element_dependencies.py View File

@@ -350,5 +350,6 @@ def main():

return 0


if __name__ == "__main__":
main()

+ 1
- 0
diskimage_builder/elements/package-installs/bin/package-installs-squash View File

@@ -191,5 +191,6 @@ def main():
final_dict, outfile,
indent=True, separators=(',', ': '), sort_keys=False)


if __name__ == '__main__':
main()

+ 1
- 0
diskimage_builder/elements/pkg-map/bin/pkg-map View File

@@ -190,6 +190,7 @@ def main():

sys.exit(0)


if __name__ == '__main__':
main()



+ 1
- 1
diskimage_builder/tests/test_elementdeps.py View File

@@ -173,7 +173,7 @@ class TestElementDeps(testtools.TestCase):
self._e('provides_new_virtual')], result)

def test_elements_provide_same(self):
msg = "virtual: already provided by \['provides_virtual'\]"
msg = r"virtual: already provided by \['provides_virtual'\]"
self.assertRaisesRegex(element_dependencies.AlreadyProvidedException,
msg,
element_dependencies.get_elements,


+ 1
- 1
requirements.txt View File

@@ -10,4 +10,4 @@ PyYAML>=3.12 # MIT
six>=1.10.0 # MIT
stevedore>=1.20.0 # Apache-2.0
# NOTE(ianw) in here because dib-lint uses flake8
hacking<1.2.0,>=1.1.0
hacking>=1.1.0

+ 1
- 1
tox.ini View File

@@ -59,7 +59,7 @@ basepython = python3
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html

[flake8]
ignore = E125,E126,E127,H202,H803
ignore = E125,E126,E127,H202,H803,W503,W504
exclude = .venv,.git,.tox,dist,doc/build,doc/source,*lib/python*,*egg,build,conf.py

[testenv:lower-constraints]


Loading…
Cancel
Save