Skip to content

Commit 735ed94

Browse files
committed
Drop deprecated API usage in HVAC
We already require hvac>=0.10.6, which is the latest. hvac has had significant refactoring, moving the python API to new locations. We do not need to keep anything that is dprecated.
1 parent 11272ec commit 735ed94

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

actions/delete_policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class VaultPolicyDeleteAction(action.VaultBaseAction):
55
def run(self, name):
6-
return self.vault.delete_policy(name)
6+
return self.vault.sys.delete_policy(name)

actions/is_initialized.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class VaultIsInitializedAction(action.VaultBaseAction):
55
def run(self):
6-
return self.vault.is_initialized()
6+
return self.vault.sys.is_initialized()

actions/read_kv.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ def run(self, path, kv_version, mount_point, version):
66
value = None
77

88
if kv_version == 1:
9-
value = self.vault.kv.v1.read_secret(path=path, mount_point=mount_point)
9+
value = self.vault.secrets.kv.v1.read_secret(
10+
path=path, mount_point=mount_point
11+
)
1012
elif kv_version == 2:
11-
value = self.vault.kv.v2.read_secret_version(path=path, mount_point=mount_point,
12-
version=version)
13+
value = self.vault.secrets.kv.v2.read_secret_version(
14+
path=path, mount_point=mount_point, version=version
15+
)
1316

1417
if value:
1518
return value['data']

actions/set_policy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33

44
class VaultPolicySetAction(action.VaultBaseAction):
55
def run(self, name, rules):
6-
return self.vault.set_policy(name, rules)
6+
return self.vault.sys.create_or_update_policy(name, rules)

0 commit comments

Comments
 (0)