From abf98ae84a332a18417b19fb58b39bfe033db508 Mon Sep 17 00:00:00 2001 From: "John L. Villalovos" Date: Sun, 28 Aug 2016 18:39:52 -0700 Subject: 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 --- ironic_python_agent/cmd/agent.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ironic_python_agent/cmd') 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, -- cgit v1.2.1