summaryrefslogtreecommitdiff
path: root/designateclient/functionaltests/v2/fixtures.py
diff options
context:
space:
mode:
authorIgor Malinovskiy <u.glide@gmail.com>2020-04-26 20:25:50 +0300
committerMichael Johnson <johnsomor@gmail.com>2023-02-13 20:51:32 +0000
commitbc39d23ff5ff45e7669cb4be9d2c28b9242cf9d9 (patch)
tree936488d5239b9ef1a7890c06006c38ec42bd3bc9 /designateclient/functionaltests/v2/fixtures.py
parent483e0d16c6b357a610634ad5f7db9ab61b41d353 (diff)
downloadpython-designateclient-5.2.0.tar.gz
Add shared zone commands5.2.0
Co-Authored-By: Michael Johnson <johnsomor@gmail.com> Change-Id: Iea92371176d9126205384624a18a9097acb3daef Partial-Bug: #1714088 Depends-On: https://review.opendev.org/#/c/726334/
Diffstat (limited to 'designateclient/functionaltests/v2/fixtures.py')
-rw-r--r--designateclient/functionaltests/v2/fixtures.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/designateclient/functionaltests/v2/fixtures.py b/designateclient/functionaltests/v2/fixtures.py
index cc5a83b..c72a18b 100644
--- a/designateclient/functionaltests/v2/fixtures.py
+++ b/designateclient/functionaltests/v2/fixtures.py
@@ -228,3 +228,25 @@ class BlacklistFixture(BaseFixture):
client.zone_blacklist_delete(blacklist_id)
except CommandFailed:
pass
+
+
+class SharedZoneFixture(BaseFixture):
+ """See DesignateCLI.recordset_create for __init__ args"""
+
+ def __init__(self, zone, *args, **kwargs):
+ super(SharedZoneFixture, self).__init__(*args, **kwargs)
+ self.zone = zone
+
+ def _setUp(self):
+ super(SharedZoneFixture, self)._setUp()
+ self.zone_share = self.client.zone_share(zone_id=self.zone.id,
+ *self.args, **self.kwargs)
+ self.addCleanup(self.cleanup_shared_zone, self.client, self.zone.id,
+ self.zone_share.id)
+
+ @classmethod
+ def cleanup_shared_zone(cls, client, zone_id, shared_zone_id):
+ try:
+ client.unshare_zone(zone_id, shared_zone_id)
+ except CommandFailed:
+ pass