Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- XENSERVER
- ================================================
- nova_plugin_version
- ================================================
- #!/usr/bin/env python
- # Copyright (c) 2013 OpenStack Foundation
- # Copyright (c) 2013 Citrix Systems, Inc.
- #
- # 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.
- # NOTE: XenServer still only supports Python 2.4 in it's dom0 userspace
- # which means the Nova xenapi plugins must use only Python 2.4 features
- """Returns the version of the nova plugins"""
- import utils
- # MAJOR VERSION: Incompatible changes
- # MINOR VERSION: Compatible changes, new plugins, etc
- # 1.0 - Initial version.
- # 1.1 - New call to check GC status
- # 1.2 - Added support for pci passthrough devices
- # 1.3 - Add vhd2 functions for doing glance operations by url
- # 1.4 - Add support of Glance v2 api
- # 1.5 - Added function for network configuration on ovs bridge
- # 1.6 - Add function for network configuration on Linux bridge
- # 1.7 - Add Partition utilities plugin
- PLUGIN_VERSION = "1.7"
- def get_version(session):
- return PLUGIN_VERSION
- if __name__ == '__main__':
- utils.register_plugin_calls(get_version)
- [root@vagxen2-srg plugins]# cat nova_plugin_version | egrep -v "(^#.*|^$)"
- """Returns the version of the nova plugins"""
- import utils
- PLUGIN_VERSION = "1.7"
- def get_version(session):
- return PLUGIN_VERSION
- if __name__ == '__main__':
- utils.register_plugin_calls(get_version)
- [root@vagxen2-srg plugins]# cat nova_plugin_version | egrep -v "(^#.*|^$)"
- """Returns the version of the nova plugins"""
- import utils
- PLUGIN_VERSION = "1.7"
- def get_version(session):
- return PLUGIN_VERSION
- if __name__ == '__main__':
- utils.register_plugin_calls(get_version)
- ================================================
- ================================================
- netwrap
- ================================================
- import gettext
- gettext.install('neutron', unicode=1)
- try:
- import json
- except ImportError:
- import simplejson as json
- import subprocess
- import XenAPIPlugin
- ALLOWED_CMDS = [
- 'ipset', 'iptables-save', 'iptables-restore', 'ip6tables-save', 'ip6tables-restore',
- 'ip',
- # NOTE(yamamoto): of_interface=native doesn't use ovs-ofctl
- 'ovs-ofctl',
- 'ovs-vsctl',
- 'ovsdb-client',
- 'sysctl',
- 'conntrack',
- ]
- class PluginError(Exception):
- """Base Exception class for all plugin errors."""
- def __init__(self, *args):
- Exception.__init__(self, *args)
- def _run_command(cmd, cmd_input):
- """Abstracts out the basics of issuing system commands. If the command
- returns anything in stderr, a PluginError is raised with that information.
- Otherwise, the output from stdout is returned.
- """
- pipe = subprocess.PIPE
- proc = subprocess.Popen(cmd, shell=False, stdin=pipe, stdout=pipe,
- stderr=pipe, close_fds=True)
- (out, err) = proc.communicate(cmd_input)
- if err:
- raise PluginError(err)
- return out
- def run_command(session, args):
- cmd = json.loads(args.get('cmd'))
- if cmd and cmd[0] not in ALLOWED_CMDS:
- msg = _("Dom0 execution of '%s' is not permitted") % cmd[0]
- raise PluginError(msg)
- result = _run_command(cmd, json.loads(args.get('cmd_input', 'null')))
- return json.dumps(result)
- if __name__ == "__main__":
- XenAPIPlugin.dispatch({"run_command": run_command})
- ================================================
- ================================================
- sysctl.conf
- ================================================
- # System default settings live in /usr/lib/sysctl.d/00-system.conf.
- # To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
- #
- # For more information, see sysctl.conf(5) and sysctl.d(5).
- net.ipv4.conf.all.rp_filter=0
- net.ipv4.conf.default.rp_filter=0
- net.bridge.bridge-nf-call-iptables=1
- net.bridge.bridge-nf-call-ip6tables=1
- ================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement