MCPcopy Create free account
hub / github.com/apache/cloudstack / CsCmdLine

Class CsCmdLine

systemvm/debian/opt/cloud/bin/cs/CsDatabag.py:52–204  ·  view source on GitHub ↗

Get cmdline config parameters

Source from the content-addressed store, hash-verified

50
51
52class CsCmdLine(CsDataBag):
53 """ Get cmdline config parameters """
54
55 def idata(self):
56 if "config" not in self.dbag:
57 self.dbag['config'] = {}
58 return self.dbag['config']
59
60 def set_guest_gw(self, val):
61 self.idata()['guestgw'] = val
62
63 def get_guest_gw(self):
64 if "guestgw" in self.idata():
65 return self.idata()['guestgw']
66 return False
67
68 def get_guest_ip6gateway(self):
69 if "guestgw6" in self.idata():
70 return self.idata()['guestgw6']
71 return False
72
73 def get_guest_ip6cidr_size(self):
74 if "guestcidr6size" in self.idata():
75 return self.idata()['guestcidr6size']
76 return False
77
78 def is_redundant(self):
79 if "redundant_router" in self.idata():
80 return self.idata()['redundant_router'] == "true"
81 return False
82
83 def set_redundant(self, val="true"):
84 self.idata()['redundant_router'] = val
85
86 def get_name(self):
87 if "name" in self.idata():
88 return self.idata()['name']
89 else:
90 return "unloved-router"
91
92 def get_type(self):
93 if "type" in self.idata():
94 return self.idata()['type']
95 else:
96 return "unknown"
97
98 def get_domain(self):
99 if "domain" in self.idata():
100 return self.idata()['domain']
101 else:
102 return "cloudnine.internal"
103
104 def get_vpccidr(self):
105 if "vpccidr" in self.idata():
106 return self.idata()['vpccidr']
107 else:
108 return "unknown"
109

Callers 6

setUpMethod · 0.90
setUpMethod · 0.90
setUpMethod · 0.90
get_cmdline_instanceMethod · 0.85
del_standardMethod · 0.85

Calls

no outgoing calls

Tested by 3

setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72