Add OS check for OSX specific keychain args

Keychain arguments are only supported on Mac OSX.
Added check for operating system so we give a
"Keychain arguments are only supported on Mac OSX"
error message rather than a "No password item matching the
provided name and account could be found in the osx keychain"
error message
This commit is contained in:
Martin O'Reilly
2017-04-05 16:36:52 +01:00
parent 1d6e1abab1
commit 0dfe5c342a

View File

@@ -16,6 +16,7 @@ import select
import subprocess
import sys
import time
import platform
try:
# python 3
from urllib.parse import urlparse
@@ -267,6 +268,8 @@ def get_auth(args, encode=True):
if not args.osx_keychain_item_account:
log_error('You must specify both name and account fields for osx keychain password items')
else:
if platform.system() != 'Darwin':
log_error("Keychain arguments are only supported on Mac OSX")
try:
with open(os.devnull,'w') as devnull:
token = (subprocess.check_output([