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) }
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 }