mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-24 16:41:10 +01:00
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:
@@ -16,6 +16,7 @@ import select
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
import platform
|
||||||
try:
|
try:
|
||||||
# python 3
|
# python 3
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
@@ -267,6 +268,8 @@ def get_auth(args, encode=True):
|
|||||||
if not args.osx_keychain_item_account:
|
if not args.osx_keychain_item_account:
|
||||||
log_error('You must specify both name and account fields for osx keychain password items')
|
log_error('You must specify both name and account fields for osx keychain password items')
|
||||||
else:
|
else:
|
||||||
|
if platform.system() != 'Darwin':
|
||||||
|
log_error("Keychain arguments are only supported on Mac OSX")
|
||||||
try:
|
try:
|
||||||
with open(os.devnull,'w') as devnull:
|
with open(os.devnull,'w') as devnull:
|
||||||
token = (subprocess.check_output([
|
token = (subprocess.check_output([
|
||||||
|
|||||||
Reference in New Issue
Block a user