# 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. # # Automatically generated by addcopyright.py at 04/03/2012 import web import socket, struct import cloud_utils from cloud_utils import Command urls = ("/ipallocator", "ipallocator") app = web.application(urls, globals()) augtool = Command("augtool") service = Command("service") class dhcp: _instance = None def __init__(self): self.availIP = [] self.router = None self.netmask = None self.initialized = False options = augtool.match( "/files/etc/dnsmasq.conf/dhcp-option").stdout.strip() for option in options.splitlines():
#! /usr/bin/python import libvirt import logging import os import sys import xml.dom.minidom from cloud_utils import Command from cloudutils.configFileOps import configFileOps from optparse import OptionParser logpath = "/var/run/cloud/" # FIXME: Logs should reside in /var/log/cloud iptables = Command("iptables") bash = Command("/bin/bash") ebtables = Command("ebtables") driver = "qemu:///system" cfo = configFileOps("/etc/cosmic/agent/agent.properties") hyper = cfo.getEntry("hypervisor.type") def execute(cmd): logging.debug(cmd) return bash("-c", cmd).stdout def can_bridge_firewall(privnic): try: execute("which iptables") except: print "no iptables on your host machine" sys.exit(1)
# under the License. import cloud_utils from cloud_utils import Command from cloudutils.configFileOps import configFileOps import logging import sys import os import xml.dom.minidom from optparse import OptionParser, OptionGroup, OptParseError, BadOptionError, OptionError, OptionConflictError, OptionValueError import re import traceback import libvirt logpath = "/var/run/cloud/" # FIXME: Logs should reside in /var/log/cloud iptables = Command("iptables") bash = Command("/bin/bash") ebtablessave = Command("ebtables-save") ebtables = Command("ebtables") def execute(cmd): logging.debug(cmd) return bash("-c", cmd).stdout def can_bridge_firewall(privnic): try: execute("which iptables") except: print "no iptables on your host machine" sys.exit(1) try: execute("which ebtables")
#!/usr/bin/python import cloud_utils from cloud_utils import Command import logging import sys import os import xml.dom.minidom from optparse import OptionParser, OptionGroup, OptParseError, BadOptionError, OptionError, OptionConflictError, OptionValueError iptables = Command("iptables") bash = Command("/bin/bash") virsh = Command("virsh") ebtablessave = Command("ebtables-save") ebtables = Command("ebtables") augtool = Command("augtool") def execute(cmd): logging.debug(cmd) return bash("-c", cmd).stdout def can_bridge_firewall(privnic): try: execute("which iptables") except: print "no iptables on your host machine" exit(1) try: execute("which ebtables") except: