mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Let's stick to CamelCase for now
This commit is contained in:
parent
e10545506d
commit
5c4d221c34
@ -19,7 +19,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from merge import dataBag
|
from merge import DataBag
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
import subprocess
|
import subprocess
|
||||||
import logging
|
import logging
|
||||||
|
|||||||
@ -15,14 +15,14 @@
|
|||||||
# KIND, either express or implied. See the License for the
|
# KIND, either express or implied. See the License for the
|
||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from merge import dataBag
|
from merge import DataBag
|
||||||
|
|
||||||
|
|
||||||
class CsDataBag(object):
|
class CsDataBag(object):
|
||||||
|
|
||||||
def __init__(self, key, config=None):
|
def __init__(self, key, config=None):
|
||||||
self.data = {}
|
self.data = {}
|
||||||
self.db = dataBag()
|
self.db = DataBag()
|
||||||
self.db.setKey(key)
|
self.db.setKey(key)
|
||||||
self.db.load()
|
self.db.load()
|
||||||
self.dbag = self.db.getDataBag()
|
self.dbag = self.db.getDataBag()
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
# KIND, either express or implied. See the License for the
|
# KIND, either express or implied. See the License for the
|
||||||
# specific language governing permissions and limitations
|
# specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
from merge import dataBag
|
from merge import DataBag
|
||||||
import CsHelper
|
import CsHelper
|
||||||
|
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ class CsGuestNetwork:
|
|||||||
def __init__(self, device):
|
def __init__(self, device):
|
||||||
self.data = {}
|
self.data = {}
|
||||||
self.guest = True
|
self.guest = True
|
||||||
db = dataBag()
|
db = DataBag()
|
||||||
db.setKey("guestnetwork")
|
db.setKey("guestnetwork")
|
||||||
db.load()
|
db.load()
|
||||||
dbag = db.getDataBag()
|
dbag = db.getDataBag()
|
||||||
|
|||||||
@ -33,7 +33,7 @@ import cs_site2sitevpn
|
|||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
|
|
||||||
class dataBag:
|
class DataBag:
|
||||||
|
|
||||||
DPATH = "/etc/cloudstack"
|
DPATH = "/etc/cloudstack"
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ class updateDataBag:
|
|||||||
self.process()
|
self.process()
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
self.db = dataBag()
|
self.db = DataBag()
|
||||||
if (self.qFile.type == "staticnatrules" or self.qFile.type == "forwardrules"):
|
if (self.qFile.type == "staticnatrules" or self.qFile.type == "forwardrules"):
|
||||||
self.db.setKey("forwardingrules")
|
self.db.setKey("forwardingrules")
|
||||||
else:
|
else:
|
||||||
@ -126,7 +126,7 @@ class updateDataBag:
|
|||||||
dp['gateway'] = d['router_guest_gateway']
|
dp['gateway'] = d['router_guest_gateway']
|
||||||
dp['nic_dev_id'] = d['device'][3]
|
dp['nic_dev_id'] = d['device'][3]
|
||||||
dp['nw_type'] = 'guest'
|
dp['nw_type'] = 'guest'
|
||||||
qf = loadQueueFile()
|
qf = QueueFile()
|
||||||
qf.load({'ip_address': [dp], 'type': 'ips'})
|
qf.load({'ip_address': [dp], 'type': 'ips'})
|
||||||
if 'domain_name' not in d.keys() or d['domain_name'] == '':
|
if 'domain_name' not in d.keys() or d['domain_name'] == '':
|
||||||
d['domain_name'] = "cloudnine.internal"
|
d['domain_name'] = "cloudnine.internal"
|
||||||
@ -181,7 +181,7 @@ class updateDataBag:
|
|||||||
dp['gateway'] = 'None'
|
dp['gateway'] = 'None'
|
||||||
dp['nic_dev_id'] = num
|
dp['nic_dev_id'] = num
|
||||||
dp['nw_type'] = nw_type
|
dp['nw_type'] = nw_type
|
||||||
qf = loadQueueFile()
|
qf = QueueFile()
|
||||||
qf.load({'ip_address': [dp], 'type': 'ips'})
|
qf.load({'ip_address': [dp], 'type': 'ips'})
|
||||||
|
|
||||||
def processVmData(self, dbag):
|
def processVmData(self, dbag):
|
||||||
@ -189,7 +189,7 @@ class updateDataBag:
|
|||||||
return dbag
|
return dbag
|
||||||
|
|
||||||
|
|
||||||
class loadQueueFile:
|
class QueueFile:
|
||||||
|
|
||||||
fileName = ''
|
fileName = ''
|
||||||
configCache = "/var/cache/cloud"
|
configCache = "/var/cache/cloud"
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from merge import loadQueueFile
|
from merge import QueueFile
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
from subprocess import PIPE, STDOUT
|
from subprocess import PIPE, STDOUT
|
||||||
@ -41,11 +41,11 @@ if not (os.path.isfile(filePath) and os.access(filePath, os.R_OK)):
|
|||||||
# If the command line json file is unprocessed process it
|
# If the command line json file is unprocessed process it
|
||||||
# This is important or, the control interfaces will get deleted!
|
# This is important or, the control interfaces will get deleted!
|
||||||
if os.path.isfile("filePath/%s" % "cmd_line.json"):
|
if os.path.isfile("filePath/%s" % "cmd_line.json"):
|
||||||
qf = loadQueueFile()
|
qf = QueueFile()
|
||||||
qf.setFile("cmd_line.json")
|
qf.setFile("cmd_line.json")
|
||||||
qf.load(None)
|
qf.load(None)
|
||||||
|
|
||||||
qf = loadQueueFile()
|
qf = QueueFile()
|
||||||
qf.setFile(sys.argv[1])
|
qf.setFile(sys.argv[1])
|
||||||
qf.load(None)
|
qf.load(None)
|
||||||
|
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsAddress(unittest.TestCase):
|
class TestCsAddress(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_needs_vrrp(self):
|
def test_needs_vrrp(self):
|
||||||
csaddress = CsAddress("ips", {})
|
csaddress = CsAddress("ips", {})
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import merge
|
|||||||
class TestCsApp(unittest.TestCase):
|
class TestCsApp(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csconfig = CsConfig()
|
csconfig = CsConfig()
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsConfig(unittest.TestCase):
|
class TestCsConfig(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_ini(self):
|
def test_ini(self):
|
||||||
csconfig = CsConfig(False)
|
csconfig = CsConfig(False)
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsDatabag(unittest.TestCase):
|
class TestCsDatabag(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csdatabag = CsDataBag("koffie")
|
csdatabag = CsDataBag("koffie")
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import merge
|
|||||||
class TestCsDhcp(unittest.TestCase):
|
class TestCsDhcp(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
@mock.patch('cs.CsDhcp.CsHelper')
|
@mock.patch('cs.CsDhcp.CsHelper')
|
||||||
@mock.patch('cs.CsDhcp.CsDnsMasq')
|
@mock.patch('cs.CsDhcp.CsDnsMasq')
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsFile(unittest.TestCase):
|
class TestCsFile(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csfile = CsFile("testfile")
|
csfile = CsFile("testfile")
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsGuestNetwork(unittest.TestCase):
|
class TestCsGuestNetwork(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csguestnetwork = CsGuestNetwork({})
|
csguestnetwork = CsGuestNetwork({})
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import merge
|
|||||||
class TestCsHelper(unittest.TestCase):
|
class TestCsHelper(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
@mock.patch('cs.CsHelper.subprocess')
|
@mock.patch('cs.CsHelper.subprocess')
|
||||||
def test_execute(self, mock_subprocess):
|
def test_execute(self, mock_subprocess):
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsNetfilter(unittest.TestCase):
|
class TestCsNetfilter(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csnetfilter = CsNetfilter()
|
csnetfilter = CsNetfilter()
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsProcess(unittest.TestCase):
|
class TestCsProcess(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csprocess = CsProcess({})
|
csprocess = CsProcess({})
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import merge
|
|||||||
class TestCsRedundant(unittest.TestCase):
|
class TestCsRedundant(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csconfig = CsConfig()
|
csconfig = CsConfig()
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsRoute(unittest.TestCase):
|
class TestCsRoute(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csroute = CsRoute(["one","two","three","four"])
|
csroute = CsRoute(["one","two","three","four"])
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import merge
|
|||||||
class TestCsRule(unittest.TestCase):
|
class TestCsRule(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
merge.dataBag.DPATH = "."
|
merge.DataBag.DPATH = "."
|
||||||
|
|
||||||
def test_init(self):
|
def test_init(self):
|
||||||
csrule = CsRule(["one", "two", "three", "four"])
|
csrule = CsRule(["one", "two", "three", "four"])
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user