Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Sep 3, 2014
1 parent e2e763e commit d50731f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/vpoller/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"""

import os
import ConfigParser
import multiprocessing
from platform import node
from ConfigParser import ConfigParser

import zmq
from vpoller.core import VPollerException
Expand All @@ -49,6 +49,7 @@ def __init__(self, config_file):
config_file (str): Path to the vPoller configuration file
"""
self.node = node()
self.config_file = config_file
self.config = {}
self.config_defaults = {
Expand Down Expand Up @@ -106,7 +107,7 @@ def load_config(self):
"""
logger.debug('Loading config file %s', self.config_file)

parser = ConfigParser.ConfigParser(self.config_defaults)
parser = ConfigParser(self.config_defaults)
parser.read(self.config_file)

self.config['mgmt'] = parser.get('proxy', 'mgmt')
Expand Down Expand Up @@ -212,11 +213,10 @@ def status(self):
'msg': 'vPoller Proxy status',
'result': {
'status': 'running',
'hostname': os.uname()[1],
'hostname': self.node,
'mgmt': self.config.get('mgmt'),
'frontend': self.config.get('frontend'),
'backend': self.config.get('backend'),
'uname': ' '.join(os.uname()),
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/vpoller/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"""
vPoller Worker module for the VMware vSphere Poller
"""
"""

import os
import types
import ConfigParser
import multiprocessing
from platform import node
from ConfigParser import ConfigParser

import zmq
from vpoller.core import VPollerException
Expand All @@ -54,6 +54,7 @@ def __init__(self, config_file, num_workers=0):
num_workers (str): Number of vPoller Worker processes to create
"""
self.node = node()
self.config_file = config_file
self.num_workers = num_workers
self.time_to_die = multiprocessing.Event()
Expand Down Expand Up @@ -112,7 +113,7 @@ def load_config(self):
"""
logger.debug('Loading config file %s', self.config_file)

parser = ConfigParser.ConfigParser(self.config_defaults)
parser = ConfigParser(self.config_defaults)
parser.read(self.config_file)

self.config['mgmt'] = parser.get('worker', 'mgmt')
Expand Down Expand Up @@ -228,12 +229,11 @@ def status(self):
'msg': 'vPoller Worker status',
'result': {
'status': 'running',
'hostname': os.uname()[1],
'hostname': self.node,
'proxy': self.config.get('proxy'),
'mgmt': self.config.get('mgmt'),
'db': self.config.get('db'),
'workers': len(self.workers),
'uname': ' '.join(os.uname()),
'concurrency': len(self.workers),
}
}

Expand Down

0 comments on commit d50731f

Please sign in to comment.