Skip to content

Commit

Permalink
Update PreFlight Script to remove SSID Check
Browse files Browse the repository at this point in the history
Summary:
IOReg can on occasion return no information about what Wireless Network a device may be connected to.
Meta's CPE Team has determined that this check is not as useful as it was, so we are removing this check entirely from our own scripts.

Removing invalid shard_over_a_week_starting since it's in the past.

Differential Revision: D61231175

fbshipit-source-id: 6e7adcedd2f769d44edacd3afae3c4a38a49e1f9
  • Loading branch information
rslowe authored and facebook-github-bot committed Aug 13, 2024
1 parent 7502045 commit b86d7f2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
23 changes: 0 additions & 23 deletions itchef/cookbooks/cpe_munki/files/default/munki_preflight.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""Munki preflight to configure Munki run settings."""

import os
import plistlib
import subprocess
import sys
import time
Expand Down Expand Up @@ -53,32 +52,10 @@ def check_munki_pause() -> None:
print(f"Unable to clear pause receipt: {e}")


def get_airport_info() -> str:
"""Get the SSID of the connected WiFi network."""
cmd = ["/usr/sbin/ioreg", "-r", "-k", "IO80211CountryCode", "-d", "1", "-a"]
proc = subprocess.run(cmd, stdout=subprocess.PIPE)
output = proc.stdout
plist_output = plistlib.loads(output)[0]
ssid = plist_output.get("IO80211SSID", "")
return ssid


def exit_if_on_wifi_shuttle() -> None:
wireless_ssid = get_airport_info()
if wireless_ssid == "fbshuttle" or wireless_ssid == 'RIDEwifi':
print("MSC will not run on shuttle wifi.")
sys.exit(1)


def main() -> None:
print("Gathering run data...")
# Verify munki pause
check_munki_pause()

runtype: str = sys.argv[1]
if runtype == "auto":
exit_if_on_wifi_shuttle()

print("Preflight completed successfully.")


Expand Down
1 change: 0 additions & 1 deletion itchef/cookbooks/cpe_munki/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
cpe_munki_defaults_config 'Manage Defaults Preferences'
cpe_munki_config 'Manage Munki Settings'

return unless node.shard_over_a_week_starting('2024-03-27')
cookbook_file 'munki_preflight.py' do
mode '0755'
owner node.root_user
Expand Down

0 comments on commit b86d7f2

Please sign in to comment.