Skip to content

Commit

Permalink
Merge pull request #5 from vital2/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
theryecatcher authored Jan 30, 2019
2 parents 3bd96d4 + 93621cc commit 6422557
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion scripts/on_xen_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ xl sched-credit -d Domain-0 -w 2048
iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

# create bonds for course networks
/home/vlab/source/xen-api/scripts/xen_course_network_startup.sh
/home/vital/source/xen-api/scripts/xen_course_network_startup.sh
4 changes: 2 additions & 2 deletions scripts/xen_course_network_startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ function add_bridge_if {
}

# reading from config file
host=$(awk -F ":" '/VITAL_DB_HOST/ {print $2}' /home/vlab/config.ini | tr -d ' ')
pass=$(awk -F ":" '/VITAL_DB_PWD/ {print $2}' /home/vlab/config.ini | tr -d ' ')
host=$(awk -F ":" '/VITAL_DB_HOST/ {print $2}' /home/vital/config.ini | tr -d ' ')
pass=$(awk -F ":" '/VITAL_DB_PWD/ {print $2}' /home/vital/config.ini | tr -d ' ')

nets=$(PGPASSWORD=$pass psql -U postgres -d vital_db -h $host -t -c "SELECT c.id from vital_course c join vital_network_configuration n on c.id=n.course_id where c.status='ACTIVE' and n.is_course_net=True")
set -f
Expand Down
4 changes: 2 additions & 2 deletions security_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
config = ConfigParser.ConfigParser()

# TODO change this to a common config file on a shared location
config.read("/home/vlab/config.ini")
config.read("/home/vital/config.ini")


def expose(func):
Expand Down Expand Up @@ -75,4 +75,4 @@ def is_authorized(func, user, passwd):
# all operations need to be authenticated
raise Exception('access to method is not supported')
finally:
conn.close()
conn.close()
7 changes: 4 additions & 3 deletions xen_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@
config = ConfigParser.ConfigParser()

# TODO change this to a common config file on a shared location
config.read("/home/vlab/config.ini")
config.read("/home/vital/config.ini")

# TODO change the logging level and file name to be read from config file
logger = logging.getLogger('xen api')
logger.setLevel(logging.DEBUG)
handler = RotatingFileHandler('/home/vlab/log/xen-api.log', maxBytes=1024*1024*10, backupCount=5)
handler = RotatingFileHandler('/home/vital/log/xen-api.log', maxBytes=1024*1024*10, backupCount=5)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)

# Initialize zmq contexts
zmqMaster = config.get("VITAL", "ZMQ_MASTER")
ctx = zmq.Context()
task_socket = ctx.socket(zmq.PUSH)
task_socket.connect('tcp://Vlab-server:5000')
task_socket.connect('tcp://' + zmqMaster + ':5000')

class XenAPI:
"""
Expand Down
2 changes: 1 addition & 1 deletion xen_api_rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
config = ConfigParser.ConfigParser()

# TODO change this to a common config file on a shared location
config.read("/home/vlab/config.ini")
config.read("/home/vital/config.ini")


# TODO Security to check if requesting user has privilege and callback security model
Expand Down

0 comments on commit 6422557

Please sign in to comment.