Skip to content

No policy.yaml file crashes runtime. #14

Description

@Saaketh0

Currently, if no policy.yaml file exists, ventis crashes with the following error:

TypeError: object of type 'NoneType' has no len()

Possible Fixes:

  • Make initialize the policy to an empty list initially, so it does nothing instead of crashing
  • Remove the len(), replace it with something better

Below is the following stack trace of the error:

File "/home/ubuntu/canyoncode/ventis/cli.py", line 339, in cmd_deploy
controller = GlobalController(config_path)
File "/home/ubuntu/canyoncode/ventis/controller/global_controller.py", line 84, in init
self._load_and_write_policies()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ubuntu/canyoncode/ventis/controller/global_controller.py", line 208, in _load_and_write_policies
len(rules),
~~~^^^^^^^
TypeError: object of type 'NoneType' has no len()

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions