unify prog-exec

This commit is contained in:
jem 2020-04-17 19:09:04 +02:00
parent ba3112ac47
commit 0c51a76248
2 changed files with 4 additions and 16 deletions

View file

@ -28,7 +28,7 @@ use_plugin("python.distutils")
default_task = "publish" default_task = "publish"
name = "ddadevops" name = "ddadevops"
version = "0.6.0.dev2" version = "0.6.0.dev3"
summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud"
description = __doc__ description = __doc__
authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")]

View file

@ -1,6 +1,4 @@
from subprocess import check_output, call from .python_util import *
import os
import sys
import deprecation import deprecation
@deprecation.deprecated(deprecated_in="0.5.0", removed_in="1.0", @deprecation.deprecated(deprecated_in="0.5.0", removed_in="1.0",
@ -17,25 +15,15 @@ def gopass_credential_from_path (path):
def gopass_field_from_path (path, field): def gopass_field_from_path (path, field):
credential = None credential = None
if path and field: if path and field:
print('get field for: ' + path + ', ' + field) print('get field for: ' + path + ', ' + field)
if sys.version_info.major == 3: credential = execute(['gopass', 'show', path, field])
credential = check_output(['gopass', 'show', path, field], encoding='UTF-8')
else:
credential = check_output(['gopass', 'show', path, field])
return credential return credential
def gopass_password_from_path (path): def gopass_password_from_path (path):
credential = None credential = None
if path: if path:
print('get password for: ' + path) print('get password for: ' + path)
if sys.version_info.major == 3: credential = execute(['gopass', 'show', '--password', path])
credential = check_output(['gopass', 'show', '--password', path], encoding='UTF-8')
else:
credential = check_output(['gopass', 'show', '--password', path])
return credential return credential