|
|
|
@ -90,14 +90,13 @@ class ImageApi:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ExecutionApi:
|
|
|
|
|
def execute(self, command: str, dry_run=False):
|
|
|
|
|
def execute(self, command: str, dry_run=False, shell=True):
|
|
|
|
|
output = ""
|
|
|
|
|
if dry_run:
|
|
|
|
|
print(command)
|
|
|
|
|
else:
|
|
|
|
|
output = check_output(command, encoding="UTF-8", shell=True)
|
|
|
|
|
output = check_output(command, encoding="UTF-8", shell=shell)
|
|
|
|
|
output = output.rstrip()
|
|
|
|
|
print(output)
|
|
|
|
|
return output
|
|
|
|
|
|
|
|
|
|
def execute_live(command):
|
|
|
|
@ -121,7 +120,7 @@ class CredentialsApi:
|
|
|
|
|
credential = None
|
|
|
|
|
if path and field:
|
|
|
|
|
print("get field for: " + path + ", " + field)
|
|
|
|
|
credential = self.execution_api.execute(["gopass", "show", path, field])
|
|
|
|
|
credential = self.execution_api.execute(["gopass", "show", path, field], shell=False)
|
|
|
|
|
return credential
|
|
|
|
|
|
|
|
|
|
def gopass_password_from_path(self, path):
|
|
|
|
@ -129,7 +128,7 @@ class CredentialsApi:
|
|
|
|
|
if path:
|
|
|
|
|
print("get password for: " + path)
|
|
|
|
|
credential = self.execution_api.execute(
|
|
|
|
|
["gopass", "show", "--password", path]
|
|
|
|
|
["gopass", "show", "--password", path], shell=False
|
|
|
|
|
)
|
|
|
|
|
return credential
|
|
|
|
|
|
|
|
|
|