示例#1
0
    def __init__(self, config, listen):
        self.team = config.get('Team', 'name')
        hub_host = config.get('Ratchet Hub', 'host')
        hub_port = int(config.get('Ratchet Hub', 'port'))
        self.ratchet_hub = RatchetHub(hub_host, hub_port)

        instance_config = self.ratchet_hub.get_qplan_instance_config(self.team)
            # NOTE: The qplan instance is the same as the vacationator instance

        update_periods = self.ratchet_hub.get_update_periods()
        error_retry_period = update_periods['error_retry']

        ratchet_hub_info = self.ratchet_hub.get_ratchet_hub_info()
        self.name = "%s/%s/CondVacationator" % (ratchet_hub_info['org_name'], self.team)

        vacationator_config = self.ratchet_hub.get_vacationator_config()
        self.horizon = int(vacationator_config['horizon'])

        SnapshotFilter.__init__(self,
                                listen,
                                instance_config['host'],
                                instance_config['req_port'],
                                instance_config['sub_port'],
                                error_retry_period,
                                [
                                    "=====raw staff",
                                    "=====raw vacation",
                                    "=====raw oncall"
                                ],
                                "=====cond vacationator"
                               )
        return
示例#2
0
    def __init__(self, config, listen):
        """
        Constructs CondQPlan using config file info and a listen flag. If the
        listen flag is False, this runs a conditioning pass once and then exits.
        If listen is True, this runs in a loop.
        """
        self.team = config.get('Team', 'name')
        hub_host = config.get('Ratchet Hub', 'host')
        hub_port = int(config.get('Ratchet Hub', 'port'))
        self.ratchet_hub = RatchetHub(hub_host, hub_port)
        instance_config = self.ratchet_hub.get_qplan_instance_config(self.team)
        update_periods = self.ratchet_hub.get_update_periods()
        error_retry_period = update_periods['error_retry']
        ratchet_hub_info = self.ratchet_hub.get_ratchet_hub_info()
        self.name = "%s/%s/CondQPlan" % (ratchet_hub_info['org_name'], self.team)

        qplan_config = self.ratchet_hub.get_qplan_config()
        self.skill_headings = self.parse_skill_headings(qplan_config['skills'])

        SnapshotFilter.__init__(self,
                                listen,
                                instance_config['host'],
                                instance_config['req_port'],
                                instance_config['sub_port'],
                                error_retry_period,
                                # TODO: Rename staff -> assignments and artists -> people
                                ["=====raw work", "=====raw staff", "=====raw vacation", "=====raw artists"],
                                "=====cond qplan"
                               )
        return
示例#3
0
    def __init__(self, config, listen):
        hub_host = config.get('Ratchet Hub', 'host')
        hub_port = int(config.get('Ratchet Hub', 'port'))

        self.ratchet_hub = RatchetHub(hub_host, hub_port)
        vantage_config = self.ratchet_hub.get_vantage_config()
        ratchet_hub_info = self.ratchet_hub.get_ratchet_hub_info()
        self.src_root = ratchet_hub_info['src_root']
        self.name = "%s/AppVantage" % (ratchet_hub_info['org_name'])

        update_periods = self.ratchet_hub.get_update_periods()
        error_retry_period = update_periods['error_retry']

        snapshot_host = vantage_config['host']
        snapshot_req_port = int(vantage_config['snapshot_req_port'])
        snapshot_sub_port = int(vantage_config['snapshot_sub_port'])

        SnapshotFilter.__init__(self,
                                listen,
                                snapshot_host,
                                snapshot_req_port,
                                snapshot_sub_port,
                                error_retry_period,
                                ["=====raw qplans"],
                                "=====app vantage"
                               )
        return
示例#4
0
    def __init__(self, config, listen):
        self.team = config.get("Team", "name")
        hub_host = config.get("Ratchet Hub", "host")
        hub_port = int(config.get("Ratchet Hub", "port"))
        self.ratchet_hub = RatchetHub(hub_host, hub_port)
        # The qplan instance is the same as the vacationator instance

        instance_config = self.ratchet_hub.get_qplan_instance_config(self.team)
        update_periods = self.ratchet_hub.get_update_periods()
        error_retry_period = update_periods["error_retry"]

        ratchet_hub_info = self.ratchet_hub.get_ratchet_hub_info()
        self.name = "%s/%s/AppVacationator" % (ratchet_hub_info["org_name"], self.team)

        SnapshotFilter.__init__(
            self,
            listen,
            instance_config["host"],
            instance_config["req_port"],
            instance_config["sub_port"],
            error_retry_period,
            ["=====cond vacationator"],
            "=====app vacationator",
        )
        return
 def __init__(self, snapshot_req_port, snapshot_sub_port, inputs):
     listen = False
     host = "127.0.0.1"
     retry_period = 1000
     output = ''
     SnapshotFilter.__init__(self, listen, host, snapshot_req_port,
                             snapshot_sub_port, retry_period, inputs, output)
     return
示例#6
0
    def __init__(self, config, listen):
        self.team = config.get('Team', 'name')
        hub_host = config.get('Ratchet Hub', 'host')
        hub_port = int(config.get('Ratchet Hub', 'port'))

        self.ratchet_hub = RatchetHub(hub_host, hub_port)
        instance_config = self.ratchet_hub.get_qplan_instance_config(self.team)
        ratchet_hub_info = self.ratchet_hub.get_ratchet_hub_info()
        self.src_root = ratchet_hub_info['src_root']
        self.name = "%s/%s/AppQPlan" % (ratchet_hub_info['org_name'], self.team)

        update_periods = self.ratchet_hub.get_update_periods()
        error_retry_period = update_periods['error_retry']

        SnapshotFilter.__init__(self,
                                listen,
                                instance_config['host'],
                                instance_config['req_port'],
                                instance_config['sub_port'],
                                error_retry_period,
                                ["=====cond qplan"],
                                "=====app qplan"
                               )
        return