Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix python problems #56

Merged
merged 4 commits into from
Dec 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions payload/Library/installapplications/installapplications.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def pkgregex(pkgpath):
pkgname = re.compile(r"[^/]+$").search(pkgpath).group(0)
return pkgname
except AttributeError as IndexError:
return packagepath
return pkgpath


def installpackage(packagepath):
Expand Down Expand Up @@ -305,7 +305,7 @@ def download_if_needed(item, stage, type, opts, depnotifystatus):
# Fix script permissions.
if os.path.splitext(path)[1] != ".pkg":
os.chmod(path, 0o755)
if type is 'userscript':
if type == 'userscript':
os.chmod(path, 0o777)


Expand Down Expand Up @@ -648,7 +648,7 @@ def main():
if depnotifystatus:
deplog('Status: Installing: %s' % (name))
# Install the package
installerstatus = installpackage(item['file'])
installpackage(item['file'])
elif type == 'rootscript':
if 'url' in item:
download_if_needed(item, stage, type, opts,
Expand All @@ -664,14 +664,13 @@ def main():
if stage == 'preflight':
preflightrun = runrootscript(path, donotwait)
if preflightrun:
iaslog('Preflight passed all checks. Skipping run.'
)
iaslog('Preflight passed all checks. Skipping run.')
userid = str(getconsoleuser()[1])
cleanup(iapath, ialdpath, ldidentifier, ialapath,
laidentifier, userid, reboot)
else:
iaslog('Preflight did not pass all checks. '
'Continuing run.')
'Continuing run.')
continue

runrootscript(path, donotwait)
Expand Down