Commit Graph

86 Commits

Author SHA1 Message Date
Greg Neagle
6b4ad647c4 Update copyright dates 2025-01-25 15:35:09 -08:00
Steve
af4296d50e manifest delete option added (#1212)
Co-authored-by: Steve Kueng <steve.kueng@umb.ch>
2024-04-01 10:53:46 -07:00
Greg Neagle
36769cdbbc Revert "Change all shebangs in prep for Python 3.12 (where symlinks to the Python executable are broken)"
This reverts commit fdec07b615.
2024-02-23 10:49:00 -08:00
Greg Neagle
fdec07b615 Change all shebangs in prep for Python 3.12 (where symlinks to the Python executable are broken) 2024-02-23 09:05:16 -08:00
Greg Neagle
2b327569b4 Update copyright dates 2024-01-30 16:14:29 -08:00
Greg Neagle
767f64b12a Update copyright info 2023-02-22 09:59:22 -08:00
Greg Neagle
5ee0f5928a Update copyright dates 2022-05-10 16:09:38 -07:00
Greg Neagle
9d3e265cb8 Update copyright dates 2021-02-20 09:05:58 -08:00
Greg Neagle
e1b5d505bc Revert "Revert "munki: rename "/usr/local/munki/python" symlink to "munki-python" (#997)""
IOW, restore the rename of "/usr/local/munki/python" symlink to "munki-python" (#997)

This reverts commit b9f9fffccc.
2020-09-15 16:46:34 -07:00
Greg Neagle
b9f9fffccc Revert "munki: rename "/usr/local/munki/python" symlink to "munki-python" (#997)"
This change is still a good future goal, but is causing problems that are too difficult to work around right now and is delaying the vital release of Munki 5.1 for Big Sur compatibility.

This reverts commit 3bb91cabca.
2020-09-15 09:04:47 -07:00
David Aguilar
3bb91cabca munki: rename "/usr/local/munki/python" symlink to "munki-python" (#997)
Avoid masking the system /usr/bin/python by calling our symlink
"munki-python" instead of "python".

Closes #996
2020-07-07 13:58:34 -07:00
Greg Neagle
72a0535d0d Update Copyright dates 2020-01-01 08:53:37 -08:00
Greg Neagle
af51af5cdd Change all sh-bang lines to #!/usr/local/munki/python 2019-07-16 22:14:47 -07:00
Greg Neagle
2f7b6c1a43 Python 3 compatibility changes for manifestutil 2019-06-22 22:18:29 -07:00
Greg Neagle
4b2327d54b More Python 3 compatibility 2019-06-04 22:27:29 -07:00
Greg Neagle
1b35782e53 Python 3 compatibility for manifestutil 2019-05-29 21:54:10 -07:00
Greg Neagle
df60207145 Add 'from __future__ import absolute_import' to all files to enforce Python3-style imports 2019-05-03 21:34:56 -07:00
Greg Neagle
531d99a01a Convert all print statements to Python3-compatible print functions 2019-05-03 19:47:37 -07:00
Elliot Jordan
2ad27ff411 Align except clauses with PEP 3110 (#933)
This should work for Python 2.6+, including 3.
https://www.python.org/dev/peps/pep-3110/#compatibility-issues
2019-05-03 15:05:13 -07:00
Elliot Jordan
d14c4304ea Various typo fixes and spelling corrections (#907)
* Fixed "No Comment" typo in strings files

* Fix "problem updates" typo

* Fix "caught" typo

* Fix "pseudo" typo

* Fix "instantiated" typo

* Fix "explicitly" typo

* Fix "osascript" typo

* Spelling fixes and various other corrections

* Fix two more instances of "Logput"

* Fixed a few remaining spelling issues in python files

* Fix "because" typo

PR also submitted upstream to the Murky project for the same correction.

* Fix name of associated app

* Additional spelling corrections in comments/docstrings
2019-02-14 08:30:43 -08:00
Greg Neagle
918d0b7391 Update copyright dates 2019-01-02 10:31:50 -08:00
Greg Neagle
1428c40d06 Update copyright notices to include 2018 2018-01-20 08:46:22 -08:00
eholtam
0e256e0ce3 Add uninstall-pkg command to managed_uninstalls in manifestutil (#797)
* Add move-install-to-uninstall command to move a pkg from managed_installs to managed_uninstalls in manifestutil

* Made this sub-command hard coded to remove from managed_installs and add to managed_uninstalls.

* Renamed command to move-install-to-uninstall
2017-08-31 18:41:18 -07:00
Greg Neagle
e042a2c8d5 Move many functions shared by the various cli tools to munkilib/cliutils.py 2017-03-13 08:03:23 -07:00
Greg Neagle
31c9b661b8 remove uneeded osutils.cleanUpTmpDir() calls 2017-03-11 18:58:35 -08:00
Greg Neagle
d1d3f5dcd2 Move code that uses FileRepo as a default if no repo is specified to munkilib/munkirepo/__init__.py 2017-03-11 09:06:09 -08:00
Greg Neagle
51d8623391 Fix for version() subcommand function 2017-03-10 14:04:11 -08:00
Greg Neagle
46376a27c8 manifestutil: handle the following cases 1) no /path/to/repo; 2) no --repo-url 3) Existing repo_path preference 2017-03-10 13:43:10 -08:00
Greg Neagle
c1a345b1ad Another fix for 'empty' repo plugin for manifestutil 2017-03-10 12:13:29 -08:00
Greg Neagle
d181ab4e7d manifestutil: when connecting to a repo, if plugin is undefined, use FileRepo 2017-03-10 10:34:53 -08:00
Greg Neagle
237a1fa365 manifestutil --configure now prompts for plugin 2017-03-09 14:10:57 -08:00
Greg Neagle
b9fbbf118d --help option for subcommands no longer exits with an unhandled MyOptParseExit exception 2017-03-09 13:27:13 -08:00
Greg Neagle
9496f1a1ef manifestutil now works with new-style FileRepo plugin 2017-03-09 13:15:16 -08:00
Greg Neagle
a3c001e550 Update manifestutil to use the new munkirepo plugin structure 2017-03-04 08:29:44 -08:00
Greg Neagle
9878259dbc manifestutil: remove import of munkicommon; replace with new refactored modules 2017-03-02 10:13:35 -08:00
Greg Neagle
1f90b8d039 Merge https://github.com/ryanyu91/munki into cloudrepo 2017-02-14 09:34:15 -08:00
Greg Neagle
4053a0dbe7 Update copyright dates to 2017 2017-01-17 20:14:31 -08:00
Ryan Yu
0afd9e1913 NEW CHANGES
************************************************************************************************************************************************************************************
https://github.com/munki/munki/pull/689#pullrequestreview-16492427
Commit based on comments by Greg Neagle on what to fix: munki#689 (master...ryanyu91:master)

makecatalogs:
removed debugging print statements

manifestutil:
check if repo is initialized before checking if it is mounted

munkiimport:
check if repo is initialized before checking if it is mounted
for def add_icon_hash_to_pkginfo(pkginfo):, not opening file (icon_path) anymore
WE_MOUNTED_THE_REPO is a repo attribute now, instead of a global variable

FileRepo:
removed duplicate/unused imports
changed class to not be old-style
updated glob method since pkgs was uninitialized
made WE_MOUNTED_THE_REPO from global variable to FileRepo attribute variable initialized to False

iconimporter:
updated Repo call to include 3 parameters now..
changed old find_items_to_check calls to new call: findItemsToCheck

Repo.py
Added support for relative paths for importing plugins
************************************************************************************************************************************************************************************

Commit based on comments by Greg Neagle on what to fix: munki#685 (master...ryanyu91:master)
IconImporter:

Not opening DMG and then mounting it anymore, directly mounting like how it was before
ManifestUtil:
Checking if the repo is mounted as well as if we (munki) mounted it. Only this will display prompt whether we want to unmount or not
FileRepo.py, Repo.py:
not hardcoding import path anymore
FileRepo - added 10.12 mounting fileshares code
************************************************************************************************************************************************************************************

Changed Files:
code/client/munkiimport
code/client/iconimporter
code/client/makecatalogs
code/client/manifestutil
code/client/munkilib/iconutils.py

Added Files:
code/client/munkilib/FileRepo.py
code/client/munkilib/Repo.py

Reason For Changes:

The purpose for this change is to enable plugins to munki that will allow writes to the munki repo to be customized.

Changes:

The methods used to write to the munki repo are the target of this modification. A plugin can create new methods for overwriting the default behavior of writing to the munki repo.

The default behavior is retained in the absence of a plugin. This is accomplished via the introduction of FileRepo.py which continues to simply write changes to the munki repo. A plugin can be introduced to change this default behavior and allow munki repo writes to be redirected as desired by the plugin author.

In order to accomplish this we have refactored all of the os.path.* methods, as well as the mount, unmount and available methods from the following tools: (iconimporter, makecatalogs, munkiimport, manifestutil, iconutils), and put them into a different python script to be used as a library or common code module. By default, these are now in the FileRepo.py module. The plugin can be used to overwrite this common code module.

In addition to the above described changes, we also made the following changes to support this plugin
concept:
•	Added the ability to add a plugin either via the command line or via munkiimport –configure
•	The code will look for custom plugins in the /usr/local/munki/munkilib/plugins/ directory
•	If plugin is found in the plugins directory, munkiimport --configure will give the option to type in the plugin name. For example, if you plugin is Foo.py, you could specify a plugin name of Foo in munkiimport --configure
•	If no plugin is found the FileRepo.py module will be used as the default common code module for writing to the munki repo
•	Add the ability to set the plugin via the --plugin option for the following tools (makecatalogs, munkiimport, manifestutil)

Testing
Tested with munkiimport on local filesystem/network shares/our own custom plugins
Tested manifestutil on local filesystem/network
Verified through regression testing, all features of munkiimport, makecatalogs, iconimporter, manifestutil from before all still work (local filesystem/network shares)
2017-01-16 13:46:53 -08:00
Ryan Yu
cfca75aca7 Pull request comments by Greg Neagle on what to fix: https://github.com/munki/munki/pull/685
IconImporter:
	- Not opening DMG and then mounting it anymore, directly mounting like how it was before
ManifestUtil:
	- Checking if the repo is mounted as well as if we (munki) mounted it. Only this will display prompt whether we want to unmount or not
FileRepo.py, Repo.py:
	- not hardcoding import path anymore
	- FileRepo - added 10.12 mounting fileshares code
2017-01-06 13:32:32 -08:00
Ryan Yu
0c475075e4 Refactored iconimporter, makecatalogs, manifestutil, iconutils Repo methods to Repo/FileRepo to support custom plugin functionality 2016-12-14 13:31:48 -08:00
Greg Neagle
069810a1ad Fixes for NetFS share mounting under 10.8.x 2016-10-31 13:54:18 -07:00
Greg Neagle
0518e4048e Make sure there is a repo_url before attempting to mount a fileshare in munkiimport and manifestutil 2016-10-24 16:18:37 -07:00
Greg Neagle
7c0a437f6c PyLint clean-ups 2016-10-24 08:26:30 -07:00
Greg Neagle
a8fb9feede Recursive indented printing of included manifests for manifestutil expand-included-manifests 2016-10-21 16:34:05 -07:00
Greg Neagle
7013581371 Really fix the fileshare mounting code in manifestutil 2016-10-21 15:58:25 -07:00
eholtam
69af0bae02 Added subcommand refresh-cache 2016-10-21 17:49:18 -05:00
Greg Neagle
4c8ed8f161 Merge branch 'master' of https://github.com/munki/munki 2016-10-21 15:39:18 -07:00
Greg Neagle
e9bdb65ade Add new Sierra-compatible fileshare mounting code to manifestutil. 2016-10-21 15:38:58 -07:00
Carl Windus
5d3521c3d7 Changed display-included-manifests to expand-included-manifests 2016-09-29 13:26:35 +10:00
Carl Windus
196eaaccf0 Added display_included_manifest() 2016-09-29 10:18:23 +10:00