Skip to content

Commit

Permalink
fix: Resolves setting save failure on empty secureli.yaml (#83)
Browse files Browse the repository at this point in the history
#77 Bugfix for failing to write ignore rule to .secureli.yml when it
does not exist yet

Note that this PR is for Github issue #77 and not Jira ticket STFT-077.
Branch was named as such to pass branch validation until branch
validation has been updated.

Adds conditional logic so that saving the settings file does not attempt
to modify the echo property if there is no echo property.
  • Loading branch information
AldosAC authored Apr 27, 2023
1 parent 53eabcd commit 6b80c20
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion secureli/repositories/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def save(self, settings: SecureliFile):
}

# Converts EchoLevel to string
settings_dict["echo"]["level"] = "{}".format(settings_dict["echo"]["level"])
if settings_dict.get("echo"):
settings_dict["echo"]["level"] = "{}".format(settings_dict["echo"]["level"])

with open(self.secureli_file_path, "w") as f:
yaml.dump(settings_dict, f)
Expand Down

0 comments on commit 6b80c20

Please sign in to comment.