From 2c28cca71d2915400e369368fc9f14c73c128339 Mon Sep 17 00:00:00 2001 From: Josh Gachnang Date: Thu, 20 Aug 2015 10:54:55 -0700 Subject: [PATCH] Enable --debug for debug logging oslo_log wasn't getting the correct config values passed in, so adding '--debug' to the command line wouldn't enable debug logging. Added docs about --debug and --standalone (the only two flags I've seen used/supported). Change-Id: Ie1ba64992444a65a40f2d65933942153b93e70c1 --- doc/source/index.rst | 18 ++++++++++++++++++ ironic_python_agent/cmd/agent.py | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/doc/source/index.rst b/doc/source/index.rst index a8432589f..6f32fab83 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -114,6 +114,23 @@ This is a generic tool that can be used to combine any initrd and kernel into a suitable ISO for booting, and so should work against any IPA ramdisk created -- both DIB and CoreOS. +IPA Flags +========= + +You can pass a variety of flags to IPA on start up to change its behavior. +If you're using the CoreOS image, you can modify the +ironic-python-agent.service unit in cloud-config.yaml [5]_. + +* --standalone: This disables the initial lookup and heartbeats to Ironic. + Lookup sends some information to Ironic in order to determine Ironic's node + UUID for the node. Heartbeat sends a periodic pings to Ironic to tell Ironic + the node is still running. These heartbeats also trigger parts of the deploy + and cleaning cycles. This flag is useful for debugging IPA without an Ironic + installation. + +* --debug: Enables debug logging. + + Hardware Managers ================= @@ -260,6 +277,7 @@ References .. [2] CoreOS Cloud Init - https://coreos.com/docs/cluster-management/setup/cloudinit-cloud-config/ .. [3] DIB Element for IPA - https://github.com/openstack/diskimage-builder/tree/master/elements/ironic-agent .. [4] Ironic Cleaning - http://docs.openstack.org/developer/ironic/deploy/cleaning.html +.. [5] cloud-config.yaml - https://github.com/openstack/ironic-python-agent/blob/master/imagebuild/coreos/oem/cloud-config.yml Indices and tables ================== diff --git a/ironic_python_agent/cmd/agent.py b/ironic_python_agent/cmd/agent.py index f89f20309..cd082908c 100644 --- a/ironic_python_agent/cmd/agent.py +++ b/ironic_python_agent/cmd/agent.py @@ -12,6 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. +import sys + from oslo_config import cfg from oslo_log import log @@ -104,8 +106,8 @@ CONF.register_cli_opts(cli_opts) def run(): log.register_options(CONF) + CONF(args=sys.argv[1:]) log.setup(CONF, 'ironic-python-agent') - CONF() agent.IronicPythonAgent(CONF.api_url, (CONF.advertise_host, CONF.advertise_port), (CONF.listen_host, CONF.listen_port),