diff options
| author | John L. Villalovos <john.l.villalovos@intel.com> | 2016-08-28 18:39:52 -0700 |
|---|---|---|
| committer | John L. Villalovos <john.l.villalovos@intel.com> | 2016-08-30 16:12:29 -0700 |
| commit | abf98ae84a332a18417b19fb58b39bfe033db508 (patch) | |
| tree | a5ab139018e8af1ef31d742fa28e400f6be593d9 /ironic_python_agent/cmd | |
| parent | ddb78ec4b333cf6dc704c69e655cf93b1a84e320 (diff) | |
| download | ironic-python-agent-abf98ae84a332a18417b19fb58b39bfe033db508.tar.gz | |
Use namedtuple to improve code readability
Use the namedtuple class to improve code readability by creating a Host
class with namedtuple to store the 'hostname' and 'port'
Replace foo[0] with foo.hostname, and foo[1] with foo.port to make code
more readable.
Change-Id: Ie2b5f9cf89e7ccbbcf0a2573dab6f6c5d14c018b
Diffstat (limited to 'ironic_python_agent/cmd')
| -rw-r--r-- | ironic_python_agent/cmd/agent.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ironic_python_agent/cmd/agent.py b/ironic_python_agent/cmd/agent.py index 0761460e..318c3882 100644 --- a/ironic_python_agent/cmd/agent.py +++ b/ironic_python_agent/cmd/agent.py @@ -35,8 +35,10 @@ def run(): CONF.set_override('debug', ipa_debug) log.setup(CONF, 'ironic-python-agent') agent.IronicPythonAgent(CONF.api_url, - (CONF.advertise_host, CONF.advertise_port), - (CONF.listen_host, CONF.listen_port), + agent.Host(hostname=CONF.advertise_host, + port=CONF.advertise_port), + agent.Host(hostname=CONF.listen_host, + port=CONF.listen_port), CONF.ip_lookup_attempts, CONF.ip_lookup_sleep, CONF.network_interface, |
