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