Skip to content

Commit ac81155

Browse files
authored
Merge pull request #1 from deploymenttheory/dev
Dev
2 parents 714f2ae + d1093d9 commit ac81155

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

jamftf/importer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def HCLs(self):
5757
"""generates hcl as a string"""
5858
out = ""
5959
hcld = self.HCLd()
60-
for i in hcld.items():
60+
for i in hcld.values():
6161
out += i + "\n"
6262

6363
return out

jamftf/options.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ def options(self):
1919
"""returns options from self"""
2020
return self.out
2121

22+
2223
def add(self, key, value):
2324
"""allows method bound addition of options"""
2425
if key not in VALID_RESOURCE_CONFIG_KEYS:
2526
raise DataError(f"attemped to add invalid config key: {key}")
2627

2728
self.out[key] = value
2829

30+
2931
def from_json(self, data: dict):
3032
"""generates options from dict"""
3133
self.out = data
@@ -42,7 +44,7 @@ def __init__(
4244
opts: dict,
4345
validate: bool,
4446
logger: Logger,
45-
exclude_ids: list[int] = []
47+
exclude_ids: list[int] | None = None
4648
):
4749

4850
self.opts = opts
@@ -72,7 +74,7 @@ def apply(self, data: dict):
7274

7375
data = options_master[o](data)
7476

75-
self.lg.info(f"{o} set for {self.resource_type}")
77+
self.lg.debug(f"{o} set for {self.resource_type}")
7678

7779
if self.exclude_ids:
7880
data = self._exclude_ids(data)
@@ -86,15 +88,15 @@ def apply(self, data: dict):
8688
def _validation(self, data):
8789
"""_validation is a parent func for running data validation functions"""
8890

89-
self.lg.debug("validating data...")
91+
self.lg.info("validating data...")
9092

9193
self._check_illegal_chars(data)
9294
self._check_duplicates(data)
9395

9496

9597
def _exclude_ids(self, data: dict) -> dict:
9698
"""removes any IDs from the data which have been specifid to be excluded"""
97-
self.lg.debug("excluding ids... %s", self.exclude_ids)
99+
self.lg.info("excluding ids... %s", self.exclude_ids)
98100

99101
to_delete = []
100102
for i in data:
@@ -119,7 +121,7 @@ def _exclude_ids(self, data: dict) -> dict:
119121

120122
def _use_resource_type_as_name(self, data: dict) -> dict:
121123
"""change the names of all resources held in data to resource_name.XX"""
122-
self.lg.debug("amending resource names...")
124+
self.lg.info("amending resource names...")
123125

124126
counter = 0
125127
for i in data:
@@ -131,7 +133,7 @@ def _use_resource_type_as_name(self, data: dict) -> dict:
131133

132134
def _check_illegal_chars(self, data: dict):
133135
"""sweeps resource names for chars invalid in HCL"""
134-
self.lg.debug(f"checking for illegal chars: {ILLEGAL_NAME_CHARS}")
136+
self.lg.info(f"checking for illegal chars: {ILLEGAL_NAME_CHARS}")
135137

136138
for i in data.values():
137139
for c in i["name"]:
@@ -141,7 +143,7 @@ def _check_illegal_chars(self, data: dict):
141143

142144
def _check_duplicates(self, data: dict):
143145
"""iterates through all resource names ensuring no duplicates"""
144-
self.lg.debug("checking for duplicates")
146+
self.lg.info("checking for duplicates")
145147

146148

147149
keys = {}

jamftf/resources.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def __init__(
2323
validate: bool = True,
2424
client: jamfpy.JamfTenant = None,
2525
debug: bool = False,
26-
exclude: list[int] = list
26+
exclude: list[int] = None
2727
):
2828

2929
self._validate_resource_type()
@@ -116,13 +116,17 @@ def _get(self):
116116
# Public
117117

118118
def set_debug(self, debug: bool):
119-
"""overrides log level to debug for all handlers"""
119+
"""overrides log level to debug for all handlers, including the applicator"""
120120
level = self._init_log_level(debug)
121121

122122
self.lg.setLevel(level)
123123
for i in self.lg.handlers:
124124
i.setLevel(level)
125125

126+
self.applicator.lg.setLevel(level)
127+
for i in self.applicator.lg.handlers:
128+
i.setLevel(level)
129+
126130
self.lg.info("log level has been overridden to: %s", self.lg.level)
127131

128132

modupdate.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
jamfpy_target_version=dev
2+
3+
########
4+
jamfpy_url="https://github.com/thejoeker12/jamfpy"
5+
6+
jamfpy_pip_target="git+$jamfpy_url@$jamfpy_target_version"
7+
8+
# pip uninstall jamfpy --no-input
9+
10+
# JAMF PY
11+
pip install --no-cache-dir --upgrade --force-reinstall $jamfpy_pip_target

0 commit comments

Comments
 (0)