Exemple #1
0
	def add_vr(self, vrid, vrtype, name="", locations=""):
		vpnid = self.get_indexvalue()
		try:
			self.manager.create("VPNVRouter", vpnid, vrid, 
				csOrionVPNVRouterType = vrtype,
				csOrionVPNVRouterName = name,
				csOrionVPNVRouterLocations = locations
				)
		except SNMP.exceptions.inconsistentValue:
			print "inconsistentValue: VR with ID %s seems to already exist." % (ipv4.itodq(vrid))
		new_vr = self.manager.get("VPNVRouter", vpnid, vrid)
		return new_vr
Exemple #2
0
	def __str__(self):
		return "%s%s%s" % (ipv4.itodq(self._address), 
				IF(self.increment, IF(self.increment>1,"+%d" % self.increment, "+"), ""),
				IF(self.bitoffset, "|%s" % self.bitoffset, "") )