Skip to content

Commit

Permalink
Merge pull request #194 from almenscorner/dev
Browse files Browse the repository at this point in the history
v2.3.1
  • Loading branch information
almenscorner committed Apr 8, 2024
2 parents e82a17d + 88d4f4b commit bfe6bff
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = IntuneCD
version = 2.3.0
version = 2.3.1
author = Tobias Almén
author_email = [email protected]
description = Tool to backup and update configurations in Intune
Expand Down
10 changes: 7 additions & 3 deletions src/IntuneCD/backup/Intune/Applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def main(self) -> dict[str, any]:
self.audit_data = self.make_audit_request(self.audit_filter)

for app in self.graph_data["value"]:
self.platform_path = ""
platform = None
base_path = self.path
app.pop("description", None)
scope_tag_data = [v for v in scope_tag_responses if app["id"] == v["id"]]
if scope_tag_data:
Expand Down Expand Up @@ -124,13 +125,14 @@ def generate_app_name(app, app_type, suffix=""):
app_name = generate_app_name(app, app_type.split(".")[2])

self.preset_filename = app_name
self.platform_path = f"{self.path}{platform}/"

self.path = f"{self.path}{platform}/"

try:
app_results = self.process_data(
data=app,
filetype=self.filetype,
path=self.platform_path,
path=self.path,
name_key="displayName",
log_message=self.LOG_MESSAGE,
audit_compare_info={"type": "resourceId", "value_key": "id"},
Expand All @@ -140,4 +142,6 @@ def generate_app_name(app, app_type, suffix=""):
self.log(tag="error", msg=f"Error processing Application data: {e}")
return None

self.path = base_path

return self.results
8 changes: 6 additions & 2 deletions src/IntuneCD/backup/Intune/ManagementIntents.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ def main(self) -> dict[str, any]:
intent_responses = self.batch_intents(self.intents_graph_data)

for item in intent_responses["value"]:
template_type = None
base_path = self.path
for template in self.template_graph_data["value"]:
if item["templateId"] == template["id"]:
template_type = template["displayName"]

self.type_path = f"{self.path}/{template_type}/"
self.path = f"{self.path}{template_type}/"

for setting in item["settingsDelta"]:
setting.pop("id", None)
Expand All @@ -78,7 +80,7 @@ def main(self) -> dict[str, any]:
results = self.process_data(
data=item,
filetype=self.filetype,
path=self.type_path,
path=self.path,
name_key="displayName",
log_message=self.LOG_MESSAGE,
audit_compare_info={"type": "resourceId", "value_key": "id"},
Expand All @@ -90,4 +92,6 @@ def main(self) -> dict[str, any]:
)
return None

self.path = base_path

return self.results
2 changes: 1 addition & 1 deletion src/IntuneCD/intunecdlib/process_audit_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _git_commit_changes(self, audit_record, path, file):
self.log(
function="_git_commit_changes",
tag="error",
msg=f"Commit was not successful, error: {commit.stderr}",
msg=f"Commit was not successful, error: {commit.stderr[:200] or commit.stdout[:200]}",
)

def _get_payload_from_audit_data(self, audit_data, compare_data):
Expand Down

0 comments on commit bfe6bff

Please sign in to comment.