ListFlags returns the list of all the flgas of a machine from Etcd etcd and machine prefix will be added to the path
()
| 184 | // ListFlags returns the list of all the flgas of a machine from Etcd |
| 185 | // etcd and machine prefix will be added to the path |
| 186 | func (m *etcdMachineInterface) ListVariables() (map[string]string, error) { |
| 187 | ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second) |
| 188 | defer cancel() |
| 189 | |
| 190 | response, err := m.keysAPI.Get(ctx, path.Join(m.etcdDS.ClusterName(), |
| 191 | "machines", m.Hostname()), nil) |
| 192 | if err != nil { |
| 193 | return nil, err |
| 194 | } |
| 195 | |
| 196 | flags := make(map[string]string) |
| 197 | for i := range response.Node.Nodes { |
| 198 | _, k := path.Split(response.Node.Nodes[i].Key) |
| 199 | flags[k] = response.Node.Nodes[i].Value |
| 200 | } |
| 201 | |
| 202 | return flags, nil |
| 203 | } |
| 204 | |
| 205 | // GetVariable Gets a machine's variable, or the global if it was not |
| 206 | // set for the machine |
nothing calls this directly
no test coverage detected