Commit Graph

6 Commits

Author SHA1 Message Date
Jake Nabasny 2380ad7cde Update command references to juju 3.x syntax
Change-Id: I4f1e1bbcf43a55b465382af914a0951aedf8c62b

Change "relate" to "integrate" in README juju cmd

Change-Id: I4f1e1bbcf43a55b465382af914a0951aedf8c62b
2023-09-20 12:07:47 -04:00
Hervé Beraud 4cbac58ba1 Use unittest.mock instead of mock
The mock third party library was needed for mock support in py2
runtimes. Since we now only support py36 and later, we can use the
standard lib unittest.mock module instead.

Note that https://github.com/openstack/charms.openstack is used during tests
and he need `mock`, unfortunatelly it doesn't declare `mock` in its
requirements so it retrieve mock from other charm project (cross dependency).
So we depend on charms.openstack first and when
Ib1ed5b598a52375e29e247db9ab4786df5b6d142 will be merged then CI
will pass without errors.

Depends-On: Ib1ed5b598a52375e29e247db9ab4786df5b6d142
Change-Id: Ib658c7f61fe4aceafc1919e366d24ce81ec1dd63
2021-12-15 09:39:12 +00:00
Nikhil Kshirsagar 489a4ede69 Do not zap a disk if it is used by lvm2
If the disk being zapped is used by lvm (if it contains the
lvm label and hasn't been pvremove'd) it's safer to simply
bail out of zapping it than attempt teardown through a force
pvremove, because the disk being zapped might be in fact in
use by some LV.

Closes-Bug: 1858519
Change-Id: I111475c5a4584a3e367c604ab51ce2ef3789ff7f
2021-08-25 11:34:42 +05:30
Robert Gildein bc071cd208 add function to check if device exists
- if the device does not exists, the action failed with message:
  '/dev/<device>: Device does not exists.'

Closes-Bug: #1885336
Change-Id: I417c0074fe64c2afceecdfb09b8673930087f65f
2020-11-25 12:54:49 +01:00
Dmitrii Shcherbakov e340cc851c ignore devices that have already been processed
Similar to how osdize in charms.ceph checks for already processed
devices we need to avoid checking if they are pristine or not.

Additionally, mapped LUKS devices need to be filtered from being zapped
as they may hold valuable data. They are only used as underlying devices
for device mapper and dmcrypt to provide a decrypted block device
abstration so if they really need to be zapped a mapping needs to be
removed first.

This change also pulls charms.ceph modifications.

Change-Id: I96b3d40b3f9e56681be142377e454b15f9e22be3
Co-Authored-By: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
Co-Authored-By: Chris Procter <chris.procter@canonical.com>
Closes-Bug: 1781453
2018-07-17 14:30:51 +03:00
Chris MacNaughton 487658abe0 Add action to zap disk(s)
This action includes configuration for disk(s) to
zap, as well as an additional required flag for
the administrator to acknowledge pending data loss

Change-Id: I3106e2f10cf132a628aad025f73161b04215598e
Related-Bug: #1698154
2018-06-04 13:08:45 +02:00