Example #1
0
	def __init__(self, CommunicationClass):
		Logger.debug("SlaveServer construct")
		
		self.stopped = False
		
		self.role_dialogs = []
		self.monitoring = None
		self.time_last_send_monitoring = 0
		
		self.ulteo_system = False
		if os.path.isfile("/usr/bin/apt-get"):
			self.ulteo_system = True
		
		
		self.dialog = Dialog(self)
		self.smRequestManager = SMRequestManager()
		
		self.communication = CommunicationClass()
		self.communication.dialogInterfaces.append(self.dialog)
Example #2
0
    def __init__(self, CommunicationClass):
        Logger.debug("SlaveServer construct")

        self.stopped = False

        self.roles = []
        self.threads = []
        self.monitoring = None
        self.time_last_send_monitoring = 0

        self.ulteo_system = False
        if os.path.exists("/etc/debian_chroot"):
            f = file("/etc/debian_chroot", 'r')
            buf = f.read()
            f.close()

            if "OVD" in buf:
                self.ulteo_system = True

        self.dialog = Dialog(self)
        self.smRequestManager = SMRequestManager()

        for role in Config.roles:
            try:
                Role = __import__("ovd.Role.%s.Role" % (role), {}, {}, "Role")

            except ImportError:
                Logger.error("Unsupported role '%s'" % (role))
                sys.exit(2)

            self.roles.append(Role.Role(self))

        dialogInstances = []
        dialogInstances.append(self.dialog)
        for role in self.roles:
            dialogInstances.append(role.dialog)

        self.communication = CommunicationClass(dialogInstances)