forked from canonical/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enforce structure on the open_port and close_port methods.
Add typing overloads to ensure that type checking will raise issues. Good: * open_port('icmp') * open_port('tcp', 1) * open_port('udp', 2) * open_port(port=3) Bad: * open_port() * open_port('icmp', 1) * open_port('tcp') * open_port('udp') * open_port(4, 'tcp') Also check that nothing bad has been done at runtime, raising an error (ModelError to be consistent with ops.testing) if one of the invalid specifications is used.
- Loading branch information
1 parent
a9c60b1
commit 9961e23
Showing
2 changed files
with
192 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters