Skip to content

Commit d5ce586

Browse files
author
Juliya Smith
committed
Code clean up
1 parent 6d19288 commit d5ce586

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

c42seceventcli/aed/args.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,18 @@ def verify_username_arg(self):
119119

120120
def verify_destination_args(self):
121121
self.destination_type = self.destination_type.lower()
122+
self._verify_destination_port()
123+
self._verify_stdout_destination()
124+
self._verify_server_destination()
125+
126+
def _verify_destination_port(self):
122127
try:
123128
self.destination_port = int(self.destination_port)
124129
except ValueError:
125130
msg = ("Destination port '{0}' not a base 10 integer.".format(self.destination_port))
126131
self._raise_value_error(msg)
132+
133+
def _verify_stdout_destination(self):
127134
if self.destination_type == "stdout" and self.destination is not None:
128135
msg = (
129136
"Destination '{0}' not applicable for stdout. "
@@ -132,10 +139,12 @@ def verify_destination_args(self):
132139
msg = msg.format(self.destination)
133140
self._raise_value_error(msg)
134141

142+
def _verify_file_destination(self):
135143
if self.destination_type == "file" and self.destination is None:
136144
msg = "Missing file name. Try: '--dest path/to/file'."
137145
self._raise_value_error(msg)
138146

147+
def _verify_server_destination(self):
139148
if self.destination_type == "server" and self.destination is None:
140149
msg = "Missing server URL. Try: '--dest https://syslog.example.com'."
141150
self._raise_value_error(msg)

0 commit comments

Comments
 (0)