chilcote / outset

Automatically process packages, profiles, and scripts during boot, login, or on demand.
572 stars 58 forks source link

Additional Python 3 preparation for Outset, and other various changes #68

Closed homebysix closed 4 years ago

homebysix commented 4 years ago

Basic tests ran successfully in both Python 2 and Python 3:

Python paths and versions

% /usr/bin/python --version
Python 2.7.16
% /usr/local/bin/python3 --version
Python 3.7.6

Python 2: help

% /usr/bin/python ./outset -h     
usage: outset [-h]
              (--boot | --login | --login-privileged | --on-demand | --login-every | --login-once | --cleanup | --version | --add-ignored-user username | --remove-ignored-user username | --add-override scripts | --remove-override scripts)

This script automatically processes packages, profiles, and/or scripts at
boot, on demand, and/or login.

optional arguments:
  -h, --help            show this help message and exit
  --boot                Used by launchd for scheduled runs at boot
  --login               Used by launchd for scheduled runs at login
  --login-privileged    Used by launchd for scheduled privileged runs at login
  --on-demand           Process scripts on demand
  --login-every         Manually process scripts in login-every
  --login-once          Manually process scripts in login-once
  --cleanup             Used by launchd to clean up on-demand dir
  --version             Show version number
  --add-ignored-user username
                        Add user to ignored list
  --remove-ignored-user username
                        Remove user from ignored list
  --add-override scripts
                        Add scripts to override list
  --remove-override scripts
                        Remove scripts from override list

Python 3: help

% /usr/local/bin/python3 ./outset -h
usage: outset [-h]
              (--boot | --login | --login-privileged | --on-demand | --login-every | --login-once | --cleanup | --version | --add-ignored-user username | --remove-ignored-user username | --add-override scripts | --remove-override scripts)

This script automatically processes packages, profiles, and/or scripts at
boot, on demand, and/or login.

optional arguments:
  -h, --help            show this help message and exit
  --boot                Used by launchd for scheduled runs at boot
  --login               Used by launchd for scheduled runs at login
  --login-privileged    Used by launchd for scheduled privileged runs at login
  --on-demand           Process scripts on demand
  --login-every         Manually process scripts in login-every
  --login-once          Manually process scripts in login-once
  --cleanup             Used by launchd to clean up on-demand dir
  --version             Show version number
  --add-ignored-user username
                        Add user to ignored list
  --remove-ignored-user username
                        Remove user from ignored list
  --add-override scripts
                        Add scripts to override list
  --remove-override scripts
                        Remove scripts from override list

Python 2: version

% /usr/bin/python ./outset --version       
2.1.0

Python 3: version

% /usr/local/bin/python3 ./outset --version  
2.1.0

Python 2: boot

% /usr/bin/python ./outset --boot
Boot processing complete

Python 3: boot

% /usr/local/bin/python3 ./outset --boot
Boot processing complete

Python 2: login

% /usr/bin/python ./outset --login       
Processing /usr/local/outset/login-every/example.sh
Output from /usr/local/outset/login-every/example.sh on stderr but it still ran successfully: /Library/LaunchAgents/com.example.plist: Operation now in progress

Processing /usr/local/outset/login-every/check_outlook.sh
Processing /usr/local/outset/login-every/check_screensaver.sh
Processing /usr/local/outset/login-every/check_uamdm.sh

Python 3: login

% /usr/local/bin/python3 ./outset --login
Processing /usr/local/outset/login-every/example.sh
Output from /usr/local/outset/login-every/example.sh on stderr but it still ran successfully: b'/Library/LaunchAgents/com.example.plist: Operation now in progress\n'
Processing /usr/local/outset/login-every/check_outlook.sh
Processing /usr/local/outset/login-every/check_screensaver.sh
Processing /usr/local/outset/login-every/check_uamdm.sh

Python 3: on-demand

% /usr/local/bin/python3 ./outset --on-demand

Python 2: on-demand

% /usr/bin/python ./outset --on-demand       
chilcote commented 4 years ago

Thanks!