Commit Graph

10 Commits

Author SHA1 Message Date
Stephen Finucane deae814611 Remove the PowerVM driver
The PowerVM driver was deprecated in November 2021 as part of change
Icdef0a03c3c6f56b08ec9685c6958d6917bc88cb. As noted there, all
indications suggest that this driver is no longer maintained and may be
abandonware. It's been some time and there's still no activity here so
it's time to abandon this for real.

This isn't as tied into the codebase as the old XenAPI driver was, so
removal is mostly a case of deleting large swathes of code. Lovely.

Change-Id: Ibf4f36136f2c65adad64f75d665c00cf2de4b400
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-08-02 15:31:19 +02:00
Stephen Finucane 89ef050b8c Use unittest.mock instead of third party mock
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib. Most of this
is autogenerated, as described below, but there is one manual change
necessary:

nova/tests/functional/regressions/test_bug_1781286.py
  We need to avoid using 'fixtures.MockPatch' since fixtures is using
  'mock' (the library) under the hood and a call to 'mock.patch.stop'
  found in that test will now "stop" mocks from the wrong library. We
  have discussed making this configurable but the option proposed isn't
  that pretty [1] so this is better.

The remainder was auto-generated with the following (hacky) script, with
one or two manual tweaks after the fact:

  import glob

  for path in glob.glob('nova/tests/**/*.py', recursive=True):
      with open(path) as fh:
          lines = fh.readlines()
      if 'import mock\n' not in lines:
          continue
      import_group_found = False
      create_first_party_group = False
      for num, line in enumerate(lines):
          line = line.strip()
          if line.startswith('import ') or line.startswith('from '):
              tokens = line.split()
              for lib in (
                  'ddt', 'six', 'webob', 'fixtures', 'testtools'
                  'neutron', 'cinder', 'ironic', 'keystone', 'oslo',
              ):
                  if lib in tokens[1]:
                      create_first_party_group = True
                      break
              if create_first_party_group:
                  break
              import_group_found = True
          if not import_group_found:
              continue
          if line.startswith('import ') or line.startswith('from '):
              tokens = line.split()
              if tokens[1] > 'unittest':
                  break
              elif tokens[1] == 'unittest' and (
                  len(tokens) == 2 or tokens[4] > 'mock'
              ):
                  break
          elif not line:
              break
      if create_first_party_group:
          lines.insert(num, 'from unittest import mock\n\n')
      else:
          lines.insert(num, 'from unittest import mock\n')
      del lines[lines.index('import mock\n')]
      with open(path, 'w+') as fh:
          fh.writelines(lines)

Note that we cannot remove mock from our requirements files yet due to
importing pypowervm unit test code in nova unit tests. This library
still uses the mock lib, and since we are importing test code and that
lib (correctly) only declares mock in its test-requirements.txt, mock
would not otherwise be installed and would cause errors while loading
nova unit test code.

[1] https://github.com/testing-cabal/fixtures/pull/49

Change-Id: Id5b04cf2f6ca24af8e366d23f15cf0e5cac8e1cc
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-08-01 17:46:26 +02:00
esberglu e997ca68b3 PowerVM Driver: vSCSI Fibre Channel volume adapter
This change adds vSCSI Fibre Channel volume support via cinder for the
PowerVM virt driver. Attach, detach, and extend are the supported
volume operations by the PowerVM vSCSI FC adapter. PowerVM CI volume
tests are run on-demand only which can be done by leaving a comment
with "powervm:volume-check".

Blueprint: powervm-vscsi
Change-Id: I632993abe70f9f98a032a35891b690db15ded6a0
2018-05-22 11:39:32 -05:00
esberglu 3bb59e393f PowerVM Driver: Snapshot
Add instance snapshot support for the PowerVM virt driver.

Blueprint: powervm-snapshot

Change-Id: I2691b09d95691915dc1065284d25ad22db41d32b
2018-04-25 14:35:12 -05:00
esberglu db686fe185 Use correct arguments in task inits
The CreateAndConnectCfgDrive and DeleteVOpt tasks were passing the
instance into the task.Task init as the first argument. The first arg
for the Task init is actually the task name [1]. This means that those
task names were string representations of the instance which will cause
failures if there are any non-ascii characters. This corrects the Task
init calls by removing instance as the first argument. The name kwarg
is now being used throughout the PowerVM tasks to avoid similar issues
in the future.

[1] https://github.com/openstack/taskflow/blob/3.1.0/taskflow/task.py#L62

Change-Id: I991a5ea33daa9a21f774fe24882ed40f990b8e0e
Closes-Bug: #1748950
2018-02-13 11:26:47 -06:00
Qing Wu Wang a31d6b02fc PowerVM driver: ovs vif
This change set adds Open vSwitch VIF support for the PowerVM virt
driver.

Change-Id: If23aeb890c4365014a9f1262647611162f981f12
Partially-Implements: blueprint powervm-nova-it-compute-driver
2018-01-16 19:02:25 -06:00
Zuul 12f43dc98f Merge "Use NoDBTestCase for powervm driver tests" 2017-12-01 01:41:28 +00:00
thorst b9b3bbf2fc PowerVM Driver: config drive
This change set adds config drive support for the PowerVM nova driver.

Change-Id: Ieaf271d21cd9bd22ec1433d0b30bb4a7158c5707
Partially-Implements: blueprint powervm-nova-it-compute-driver
2017-11-16 16:15:03 -06:00
esberglu c352901ce4 Use NoDBTestCase for powervm driver tests
TestCase is being replaced by NoDBTestCase for the powervm driver test
code. This will prevent running the database schema migrations
unnecessarily and will let the developer know if the tests touch the
DB when the test case is claiming that it shouldn't.

Change-Id: I2b04b785c71c6f2cc825215e2773a00e85a67a89
2017-11-15 09:55:53 -06:00
Eric Fried f112dc686d PowerVM Driver: SSP emphemeral disk support
Add support for nova ephemeral disk backed by PowerVM Shared Storage
Pools (a cluster file system).

Change-Id: I3cf397e3b30b083eb46ea29c1817b61558d1e558
Partially-Implements: blueprint powervm-nova-compute-driver
2017-05-25 16:21:23 -05:00