4458N/A#!/usr/bin/python2.7
4458N/A
4458N/A# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
4458N/A#
4458N/A# Licensed under the Apache License, Version 2.0 (the "License"); you may
4458N/A# not use this file except in compliance with the License. You may obtain
4458N/A# a copy of the License at
4458N/A#
4458N/A# http://www.apache.org/licenses/LICENSE-2.0
4458N/A#
4458N/A# Unless required by applicable law or agreed to in writing, software
4458N/A# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
4458N/A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
4458N/A# License for the specific language governing permissions and limitations
4458N/A# under the License.
4458N/A
4458N/Aimport os
4458N/Aimport sys
4458N/A
4458N/Aimport smf_include
4458N/A
4458N/A
4458N/Adef start():
4458N/A ironic_conf = sys.argv[2]
4458N/A
4458N/A # verify config path is valid
4458N/A if not os.path.exists(ironic_conf) or not os.access(ironic_conf, os.R_OK):
4458N/A print >> sys.stderr, '%s does not exist or is not readable' % \
4458N/A ironic_conf
4458N/A return smf_include.SMF_EXIT_ERR_CONFIG
4458N/A
4458N/A # Initiate ironic-api service
4458N/A cmd_str = "/usr/lib/ironic/ironic-api --config-file %s " \
4458N/A % (ironic_conf)
4458N/A smf_include.smf_subprocess(cmd_str)
4458N/A
4458N/Aif __name__ == "__main__":
4458N/A os.putenv("LC_ALL", "C")
4458N/A smf_include.smf_main()