jssimporter / jss_helper

jss_helper is deprecated.
GNU General Public License v3.0
66 stars 7 forks source link

jss_helper category Name does not yield results #27

Closed krispayne closed 4 years ago

krispayne commented 4 years ago

Going through and exploring the beta this morning:



++ jss_helper: 2.2.0b2 ++ python-jss: 2.1 ++

JSS: https://server.com:8443
Preferences: ~/Library/Preferences/com.github.autopkg.plist

usage: jss_helper category [-h] [search]

List all categories, or search for an individual category.

positional arguments:
  search      ID or name (wildcards allowed) of category.

optional arguments:
  -h, --help  show this help message and exit
[autopkg@vnetboot AutoPkg]$ jss_helper category Printers

++ jss_helper: 2.2.0b2 ++ python-jss: 2.1 ++

JSS: https://server.com:8443
Preferences: ~/Library/Preferences/com.github.autopkg.plist

Traceback (most recent call last):
  File "/usr/local/bin/jss_helper", line 118, in <module>
    main()
  File "/usr/local/bin/jss_helper", line 111, in main
    func(args)
  File "/usr/local/bin/jss_helper_lib/tools.py", line 294, in search_func
    print(result)
  File "/Library/AutoPkg/JSSImporter/jss/tools.py", line 174, in trigger_cache
    return func(self, *args, **kwargs)
  File "/Library/AutoPkg/JSSImporter/jss/tools.py", line 174, in trigger_cache
    return func(self, *args, **kwargs)
  File "/Library/AutoPkg/JSSImporter/jss/tools.py", line 157, in element_str
    pretty_data = copy.deepcopy(elem)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 169, in deepcopy
    rv = reductor(4)
TypeError: Cannot pickle Objective-C objects
[autopkg@vnetboot AutoPkg]$ jss_helper category

++ jss_helper: 2.2.0b2 ++ python-jss: 2.1 ++

JSS: https://server.com:8443
Preferences: ~/Library/Preferences/com.github.autopkg.plist

ID:  1  NAME: Unknown
ID:  2  NAME: Web browsers
ID:  3  NAME: Dependencies
ID:  4  NAME: Utilities
ID:  5  NAME: Productivity
ID:  6  NAME: Security
ID:  7  NAME: Settings
ID:  8  NAME: OS
ID:  9  NAME: Testing
ID: 10  NAME: Scripts
ID: 11  NAME: Printers
ID: 12  NAME: Printer Drivers
ID: 17  NAME: Communications
ID: 19  NAME: Editors
ID: 20  NAME: Languages
ID: 24  NAME: Auto Update
ID: 27  NAME: Check-in
ID: 39  NAME: @_Enrollment
ID: 43  NAME: Certificates
ID: 50  NAME: Microsoft

[autopkg@vnetboot AutoPkg]$ jss_helper category 11

++ jss_helper: 2.2.0b2 ++ python-jss: 2.1 ++

JSS: https://server.com:8443
Preferences: ~/Library/Preferences/com.github.autopkg.plist

Traceback (most recent call last):
  File "/usr/local/bin/jss_helper", line 118, in <module>
    main()
  File "/usr/local/bin/jss_helper", line 111, in main
    func(args)
  File "/usr/local/bin/jss_helper_lib/tools.py", line 294, in search_func
    print(result)
  File "/Library/AutoPkg/JSSImporter/jss/tools.py", line 174, in trigger_cache
    return func(self, *args, **kwargs)
  File "/Library/AutoPkg/JSSImporter/jss/tools.py", line 174, in trigger_cache
    return func(self, *args, **kwargs)
  File "/Library/AutoPkg/JSSImporter/jss/tools.py", line 157, in element_str
    pretty_data = copy.deepcopy(elem)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 180, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 280, in _reconstruct
    state = deepcopy(state, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 150, in deepcopy
    y = copier(x, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 240, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/Library/AutoPkg/Python3/Python.framework/Versions/Current/lib/python3.7/copy.py", line 169, in deepcopy
    rv = reductor(4)
TypeError: Cannot pickle Objective-C objects
[autopkg@vnetboot AutoPkg]$```
grahampugh commented 4 years ago

Please try 2.2.0b3

krispayne commented 4 years ago
[autopkg@vnetboot AutoPkg]$ jss_helper category printers

++ jss_helper: 2.2.0b2 ++ python-jss: 2.1 ++

JSS: https://server.com:8443
Preferences: ~/Library/Preferences/com.github.autopkg.plist

ID: 11  NAME: Printers

[autopkg@vnetboot AutoPkg]$

Works. Version number printed when running jss_helper is incorrect, though.

grahampugh commented 4 years ago

Ah snap. I have to update the version number in 3 places... there must be a more efficient way :)

krispayne commented 4 years ago

I think we've got those variable things nowadays ;-)

grahampugh commented 4 years ago

You'd think, eh?

Anyway, updated now.

krispayne commented 4 years ago

great. Let me know if you want any more beta testing done. This is an indispensable tool for me

grahampugh commented 4 years ago

Test as much as possible and let me know anything that's broken! I don't use it much so I'm relying on the real users to test :)