Closed FredCox3 closed 9 years ago
Take a peek at the diff-my mistake was thinking that the positional args from JAMF would come before the optional args. In fact, it's the opposite.
argparse has a parse_known_args() method which splits the args into a namespace dict and a tuple of unrecognized arguments which serves to just toss away the unused $1-$3 from JAMF.
Switching over from Twitter so I don't blow up your feed.
I added a print(args) when running from a Policy on the JSS. Here's a sample output:
Script result: Namespace(jamf-arguments=['/', 'ComputerName', 'SelfServiceUsername', '-r', '', '', '', '', '', '', ''], quarantine=False, remove=False, stdout=False, verbose=False)
Since the jamf-arguments are a seperate list, it doesn't appear the if args.remove is picking up that -r has been passed from Casper so it just runs the else condition.