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