diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-12-09 14:25:30 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-12-09 14:25:30 +0000 |
| commit | fab21cadd03e2ce2ca781ce3783abd7f981f338f (patch) | |
| tree | 99305efa2f7c776d1e2374f170c9f89b84d0f4da | |
| parent | 774072b26d414f3ba4f844458fced2a9204fe9cd (diff) | |
| parent | 6488c4b3b8770590b30b740d8092e0b022b64930 (diff) | |
| download | kolla-fab21cadd03e2ce2ca781ce3783abd7f981f338f.tar.gz kolla-fab21cadd03e2ce2ca781ce3783abd7f981f338f.zip | |
Merge "Remove useless script from repo"
| -rw-r--r-- | docker/neutron/neutron-base/ip_wrapper.py | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/docker/neutron/neutron-base/ip_wrapper.py b/docker/neutron/neutron-base/ip_wrapper.py deleted file mode 100644 index 3496be768..000000000 --- a/docker/neutron/neutron-base/ip_wrapper.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -# Copyright 2015 Sam Yaple -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# This file exists because we want to create and delete any network -# namespaces from the host mount namespace. This allows the host to -# access all of the neutron network namespaces as well as all -# containers that bind mount /run/netns from the host. - -# This is required for "thin" neutron containers to function properly. However, -# due to a missing feature/bug in Docker it is not possible to use this script -# at this time. Once Docker updates with this feature we will usre this again. - -import nsenter -import subprocess # nosec -import sys - - -def host_mnt_exec(cmd): - try: - with nsenter.ExitStack() as stack: - stack.enter_context( - nsenter.Namespace( - '1', - 'mnt', - proc='/var/lib/kolla/host_proc/')) - process_ = subprocess.Popen(cmd) # nosec - - except Exception as e: - print( - "An error has occurred with a component that Kolla manages." - " Please file a bug") - print("Error: ", e) - - return process_ - - -if len(sys.argv) > 2: - # We catch all commands that ip will accept that refer - # to creating or deleteing a Network namespace - if str(sys.argv[1]).startswith("net") and ( - str(sys.argv[2]).startswith("a") or - str(sys.argv[2]).startswith("d")): - # This cmd is executed in the host mount namespace - cmd = ["/usr/bin/env", "ip"] + sys.argv[1:] - sys.exit(host_mnt_exec(cmd).returncode) - else: - cmd = ["/var/lib/kolla/ip"] + sys.argv[1:] -else: - cmd = ["/var/lib/kolla/ip"] - - if len(sys.argv) == 2: - cmd = cmd + sys.argv[1:] - -process_ = subprocess.Popen(cmd) # nosec -sys.exit(process_.returncode) |
