Exemplo n.º 1
0
func (c *Client) RequestLock() {
	elc, err := lock.NewEtcdLockClient(nil)
	if err != nil {
		fmt.Fprintln(os.Stderr, "Error initializing etcd client:", err)
	}
	var mID string
	mID = utils.GetMachineID("/")
	if mID == "" {
		fmt.Fprintln(os.Stderr, "Cannot read machine-id")
	}
	c.lock = lock.New(mID, elc)
}
Exemplo n.º 2
0
func (c *FleetClient) GetLocaljobs() sort.StringSlice {
	var sortable sort.StringSlice
	unitStates, err := c.Fleet.UnitStates()
	if err != nil {
		return sortable
	}
	for _, us := range unitStates {
		if strings.HasPrefix(us.Name, "deis-") && us.MachineID == utils.GetMachineID("/") {
			sortable = append(sortable, us.Name)
		}
	}
	return sortable
}