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