+#!/usr/bin/env python
# -*- coding: utf-8 -*-
##
import threading
import vim_db
import logging
-import threading
import imp
import host_thread as ht
import dhcp_thread as dt
import openflow_thread as oft
from netaddr import IPNetwork
from jsonschema import validate as js_v, exceptions as js_e
+import openflow_conn
+import argparse
HTTP_Bad_Request = 400
HTTP_Unauthorized = 401
try:
if self.of_test_mode:
- return oft.of_test_connector({"name": db_config['type'], "dpid": db_config['dpid'],
- "of_debug": self.config['log_level_of']})
+ return openflow_conn.OfTestConnector({"name": db_config['type'],
+ "dpid": db_config['dpid'],
+ "of_debug": self.config['log_level_of']})
temp_dict = {}
if db_config:
"""
# create openflow thread
- if 'of_controller_nets_with_same_vlan' in self.config:
- ofc_net_same_vlan = self.config['of_controller_nets_with_same_vlan']
- else:
- ofc_net_same_vlan = False
+ #if 'of_controller_nets_with_same_vlan' in self.config:
+ # ofc_net_same_vlan = self.config['of_controller_nets_with_same_vlan']
+ #else:
+ # ofc_net_same_vlan = False
+ ofc_net_same_vlan = False
thread = oft.openflow_thread(ofc_uuid, of_conn, of_test=self.of_test_mode, db=self.db_of, db_lock=self.db_lock,
pmp_with_same_vlan=ofc_net_same_vlan, debug=self.config['log_level_of'])
controller_host.create_dhcp_interfaces(vlan, first_ip, dhcp_netmask)
controller_host.launch_dhcp_server(vlan, ip_range, dhcp_netmask, dhcp_path, gateway)
+if __name__ == "__main__":
+
+ parser = argparse.ArgumentParser()
+ parser.add_argument("-v","--version", help="increase output verbosity", action="store_true")
+ args = parser.parse_args()
+ if args.version:
+ print ('openvimd version {} {}'.format(ovim.get_version(), ovim.get_version_date()))
+ print ('(c) Copyright Telefonica')