Merge lp:~jtv/maas/maas-enlist-cleanup into lp:~maas-maintainers/maas/maas-enlist

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 39
Proposed branch: lp:~jtv/maas/maas-enlist-cleanup
Merge into: lp:~maas-maintainers/maas/maas-enlist
Diff against target: 654 lines (+0/-633)
4 files modified
avahi-discover/Makefile (+0/-10)
avahi-discover/maas-avahi-discover.c (+0/-254)
bin/maas-signal (+0/-262)
sbin/maas-ipmi-autodetect (+0/-107)
To merge this branch: bzr merge lp:~jtv/maas/maas-enlist-cleanup
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+206975@code.launchpad.net

Commit message

Remove files from maas-enlist that are no longer used.

Description of the change

Most of these were pointed out by Andres. Only two files (in two directories) are left.

Jeroen

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed directory 'avahi-discover'
2=== removed file 'avahi-discover/Makefile'
3--- avahi-discover/Makefile 2012-03-21 02:07:45 +0000
4+++ avahi-discover/Makefile 1970-01-01 00:00:00 +0000
5@@ -1,10 +0,0 @@
6-CFLAGS := $(shell pkg-config --cflags avahi-core) -g -Wall
7-LDFLAGS := $(shell pkg-config --libs avahi-core) -ldebian-installer
8-
9-all: maas_find_component
10-
11-maas_find_component:
12- $(CC) $(CFLAGS) maas-avahi-discover.c -o maas-avahi-discover $(LDFLAGS)
13-
14-clean:
15- rm -f maas-avahi-discover
16
17=== removed file 'avahi-discover/maas-avahi-discover.c'
18--- avahi-discover/maas-avahi-discover.c 2012-03-21 02:07:45 +0000
19+++ avahi-discover/maas-avahi-discover.c 1970-01-01 00:00:00 +0000
20@@ -1,254 +0,0 @@
21-/* $Id$ */
22-
23-/***
24- This file is based on an example that is part of avahi, which is copyright:
25- Lennart Poettering <lennart (at) poettering (dot) de>
26- Trent Lloyd <lathiat@bur.st>
27- Sebastien Estienne <sebastien.estienne@gmail.com>
28- Jakub Stachowski
29- James Willcox <snorp@snorp.net>
30- Collabora Ltd.
31- Modifications for mass-enlist-udeb are copyright 2009-2012 Canonical Ltd.
32-
33- avahi is free software; you can redistribute it and/or modify it
34- under the terms of the GNU Lesser General Public License as
35- published by the Free Software Foundation; either version 2.1 of the
36- License, or (at your option) any later version.
37-
38- avahi is distributed in the hope that it will be useful, but WITHOUT
39- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
40- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
41- Public License for more details.
42-
43- You should have received a copy of the GNU Lesser General Public
44- License along with avahi; if not, write to the Free Software
45- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
46- USA.
47-***/
48-
49-#ifdef HAVE_CONFIG_H
50-#include <config.h>
51-#endif
52-
53-#include <stdio.h>
54-#include <assert.h>
55-#include <stdlib.h>
56-#include <time.h>
57-#include <string.h>
58-
59-#include <avahi-core/core.h>
60-#include <avahi-core/lookup.h>
61-#include <avahi-core/log.h>
62-#include <avahi-common/simple-watch.h>
63-#include <avahi-common/malloc.h>
64-#include <avahi-common/error.h>
65-
66-#include <debian-installer.h>
67-
68-static AvahiSimplePoll *simple_poll = NULL;
69-static AvahiServer *server = NULL;
70-
71-static di_hash_table *resolver_hash = NULL;
72-
73-static int debug = 0;
74-
75-static void quiet_logger(AvahiLogLevel level, const char *txt) {
76-}
77-
78-static bool resolver_equal_func(const void *key1, const void *key2) {
79- return !strcmp((const char *) key1, (const char *) key2);
80-}
81-
82-static uint32_t resolver_hash_func(const void *key) {
83- /* save reimplementing our own hash algorithm ... */
84- di_rstring rstring;
85- rstring.string = (char *) key;
86- rstring.size = strlen(key);
87- return di_rstring_hash(&rstring);
88-}
89-
90-static void resolve_callback(
91- AvahiSServiceResolver *r,
92- AVAHI_GCC_UNUSED AvahiIfIndex interface,
93- AVAHI_GCC_UNUSED AvahiProtocol protocol,
94- AvahiResolverEvent event,
95- const char *name,
96- const char *type,
97- const char *domain,
98- const char *host_name,
99- const AvahiAddress *address,
100- uint16_t port,
101- AvahiStringList *txt,
102- AvahiLookupResultFlags flags,
103- AVAHI_GCC_UNUSED void* userdata) {
104-
105- assert(r);
106-
107- /* Called whenever a service has been resolved successfully or timed out */
108-
109- switch (event) {
110- case AVAHI_RESOLVER_FAILURE:
111- if (debug)
112- fprintf(stderr, "(Resolver) Failed to resolve service '%s' of type '%s' in domain '%s': %s\n", name, type, domain, avahi_strerror(avahi_server_errno(server)));
113- break;
114-
115- case AVAHI_RESOLVER_FOUND: {
116- char *human_address = avahi_malloc0(AVAHI_ADDRESS_STR_MAX);
117- char *key = NULL;
118- if (avahi_address_snprint(human_address, AVAHI_ADDRESS_STR_MAX, address)) {
119- if (address->proto == AVAHI_PROTO_INET6)
120- key = avahi_strdup_printf("[%s]:%u", human_address, port);
121- else if (strncmp(human_address, "169.254.169.254", 15) == 0)
122- key = avahi_strdup_printf("%s:%u", name, port);
123- else
124- key = avahi_strdup_printf("%s:%u", human_address, port);
125- } else {
126- if (debug)
127- fprintf(stderr, "(Resolver) failed to resolve %s to IP address/port\n", key);
128- }
129- avahi_free(human_address);
130-
131- if (di_hash_table_lookup(resolver_hash, key)) {
132- if (debug)
133- fprintf(stderr, "(Resolver) Already seen %s\n", key);
134- free(key);
135- } else {
136- di_hash_table_insert(resolver_hash, key, "");
137- if (debug)
138- fprintf(stderr, "(Resolver) Service '%s' of type '%s' in domain '%s':\n", name, type, domain);
139- printf("%s|%s\n", name, key);
140-
141- }
142- /* don't free key; di_hash_table_insert doesn't copy it */
143- }
144- }
145-
146- avahi_s_service_resolver_free(r);
147-}
148-
149-static void browse_callback(
150- AvahiSServiceBrowser *b,
151- AvahiIfIndex interface,
152- AvahiProtocol protocol,
153- AvahiBrowserEvent event,
154- const char *name,
155- const char *type,
156- const char *domain,
157- AVAHI_GCC_UNUSED AvahiLookupResultFlags flags,
158- void* userdata) {
159-
160- AvahiServer *s = userdata;
161- assert(b);
162-
163- /* Called whenever a new services becomes available on the LAN or is removed from the LAN */
164-
165- switch (event) {
166-
167- case AVAHI_BROWSER_FAILURE:
168- fprintf(stderr, "(Browser) %s\n", avahi_strerror(avahi_server_errno(server)));
169- avahi_simple_poll_quit(simple_poll);
170- return;
171-
172- case AVAHI_BROWSER_NEW:
173- if (debug)
174- fprintf(stderr, "(Browser) NEW: service '%s' of type '%s' in domain '%s'\n", name, type, domain);
175-
176- /* We ignore the returned resolver object. In the callback
177- function we free it. If the server is terminated before
178- the callback function is called the server will free
179- the resolver for us. */
180-
181- if (!(avahi_s_service_resolver_new(s, interface, protocol, name, type, domain, AVAHI_PROTO_INET, 0, resolve_callback, s)))
182- fprintf(stderr, "Failed to resolve service '%s': %s\n", name, avahi_strerror(avahi_server_errno(s)));
183-
184- break;
185-
186- case AVAHI_BROWSER_REMOVE:
187- if (debug)
188- fprintf(stderr, "(Browser) REMOVE: service '%s' of type '%s' in domain '%s'\n", name, type, domain);
189- break;
190-
191- case AVAHI_BROWSER_ALL_FOR_NOW:
192- if (debug)
193- fprintf(stderr, "(Browser) %s\n", "ALL_FOR_NOW");
194- exit(0);
195- break;
196-
197- case AVAHI_BROWSER_CACHE_EXHAUSTED:
198- if (debug)
199- fprintf(stderr, "(Browser) %s\n", "CACHE_EXHAUSTED");
200- break;
201- }
202-}
203-
204-int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
205- AvahiServerConfig config;
206- AvahiSServiceBrowser *sb = NULL;
207- int error;
208- int ret = 1;
209-
210- if (getenv("MAAS_ENLIST_DEBUG"))
211- debug = 1;
212-
213- /* Initialize the pseudo-RNG */
214- srand(time(NULL));
215-
216- if (!debug)
217- avahi_set_log_function(quiet_logger);
218-
219- /* Allocate main loop object */
220- if (!(simple_poll = avahi_simple_poll_new())) {
221- fprintf(stderr, "Failed to create simple poll object.\n");
222- goto fail;
223- }
224-
225- /* Do not publish any local records */
226- avahi_server_config_init(&config);
227- config.publish_hinfo = 0;
228- config.publish_addresses = 0;
229- config.publish_workstation = 0;
230- config.publish_domain = 0;
231-
232- /* Allocate a new server */
233- server = avahi_server_new(avahi_simple_poll_get(simple_poll), &config, NULL, NULL, &error);
234-
235- /* Free the configuration data */
236- avahi_server_config_free(&config);
237-
238- /* Check whether creating the server object succeeded */
239- if (!server) {
240- fprintf(stderr, "Failed to create server: %s\n", avahi_strerror(error));
241- goto fail;
242- }
243-
244- /* Create the service browser */
245- if (!(sb = avahi_s_service_browser_new(server, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, "_maas._tcp", NULL, 0, browse_callback, server))) {
246- fprintf(stderr, "Failed to create service browser: %s\n", avahi_strerror(avahi_server_errno(server)));
247- goto fail;
248- }
249-
250- /* Create a hash table so we can uniquify resolver results */
251- resolver_hash = di_hash_table_new_full(resolver_hash_func, resolver_equal_func, avahi_free, NULL);
252-
253- /* Run the main loop */
254- avahi_simple_poll_loop(simple_poll);
255-
256- ret = 0;
257-
258-fail:
259-
260- if (resolver_hash)
261- di_hash_table_destroy (resolver_hash);
262-
263- /* Cleanup things */
264- if (sb)
265- avahi_s_service_browser_free(sb);
266-
267- if (server)
268- avahi_server_free(server);
269-
270- if (simple_poll)
271- avahi_simple_poll_free(simple_poll);
272-
273- return ret;
274-}
275
276=== removed file 'bin/maas-signal'
277--- bin/maas-signal 2012-10-09 20:05:42 +0000
278+++ bin/maas-signal 1970-01-01 00:00:00 +0000
279@@ -1,262 +0,0 @@
280-#!/usr/bin/python
281-
282-from email.utils import parsedate
283-import mimetypes
284-import oauth.oauth as oauth
285-import os.path
286-import random
287-import string
288-import sys
289-import time
290-import urllib2
291-import yaml
292-import json
293-
294-MD_VERSION = "2012-03-01"
295-VALID_STATUS = ("OK", "FAILED", "WORKING")
296-POWER_TYPES = ("ipmi", "virsh", "ether_wake")
297-
298-
299-def _encode_field(field_name, data, boundary):
300- return ('--' + boundary,
301- 'Content-Disposition: form-data; name="%s"' % field_name,
302- '', str(data))
303-
304-
305-def _encode_file(name, fileObj, boundary):
306- return ('--' + boundary,
307- 'Content-Disposition: form-data; name="%s"; filename="%s"' %
308- (name, name),
309- 'Content-Type: %s' % _get_content_type(name),
310- '', fileObj.read())
311-
312-
313-def _random_string(length):
314- return ''.join(random.choice(string.letters) for ii in range(length + 1))
315-
316-
317-def _get_content_type(filename):
318- return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
319-
320-
321-def encode_multipart_data(data, files):
322- """Create a MIME multipart payload from L{data} and L{files}.
323-
324- @param data: A mapping of names (ASCII strings) to data (byte string).
325- @param files: A mapping of names (ASCII strings) to file objects ready to
326- be read.
327- @return: A 2-tuple of C{(body, headers)}, where C{body} is a a byte string
328- and C{headers} is a dict of headers to add to the enclosing request in
329- which this payload will travel.
330- """
331- boundary = _random_string(30)
332-
333- lines = []
334- for name in data:
335- lines.extend(_encode_field(name, data[name], boundary))
336- for name in files:
337- lines.extend(_encode_file(name, files[name], boundary))
338- lines.extend(('--%s--' % boundary, ''))
339- body = '\r\n'.join(lines)
340-
341- headers = {'content-type': 'multipart/form-data; boundary=' + boundary,
342- 'content-length': str(len(body))}
343-
344- return body, headers
345-
346-
347-def oauth_headers(url, consumer_key, token_key, token_secret, consumer_secret,
348- clockskew=0):
349- consumer = oauth.OAuthConsumer(consumer_key, consumer_secret)
350- token = oauth.OAuthToken(token_key, token_secret)
351-
352- timestamp = int(time.time()) + clockskew
353-
354- params = {
355- 'oauth_version': "1.0",
356- 'oauth_nonce': oauth.generate_nonce(),
357- 'oauth_timestamp': timestamp,
358- 'oauth_token': token.key,
359- 'oauth_consumer_key': consumer.key,
360- }
361- req = oauth.OAuthRequest(http_url=url, parameters=params)
362- req.sign_request(oauth.OAuthSignatureMethod_PLAINTEXT(),
363- consumer, token)
364- return(req.to_header())
365-
366-
367-def geturl(url, creds, headers=None, data=None):
368- # Takes a dict of creds to be passed through to oauth_headers,
369- # so it should have consumer_key, token_key, ...
370- if headers is None:
371- headers = {}
372- else:
373- headers = dict(headers)
374-
375- clockskew = 0
376-
377- def warn(msg):
378- sys.stderr.write(msg + "\n")
379-
380- exc = Exception("Unexpected Error")
381- for naptime in (1, 1, 2, 4, 8, 16, 32):
382- if creds.get('consumer_key', None) != None:
383- headers.update(oauth_headers(url,
384- consumer_key=creds['consumer_key'],
385- token_key=creds['token_key'],
386- token_secret=creds['token_secret'],
387- consumer_secret=creds['consumer_secret'],
388- clockskew=clockskew))
389- try:
390- req = urllib2.Request(url=url, data=data, headers=headers)
391- return(urllib2.urlopen(req).read())
392- except urllib2.HTTPError as exc:
393- if 'date' not in exc.headers:
394- warn("date field not in %d headers" % exc.code)
395- pass
396- elif (exc.code == 401 or exc.code == 403):
397- date = exc.headers['date']
398- try:
399- ret_time = time.mktime(parsedate(date))
400- clockskew = int(ret_time - time.time())
401- warn("updated clock skew to %d" % clockskew)
402- except:
403- warn("failed to convert date '%s'" % date)
404- except Exception as exc:
405- pass
406-
407- warn("request to %s failed. sleeping %d.: %s" % (url, naptime, exc))
408- time.sleep(naptime)
409-
410- raise exc
411-
412-
413-def read_config(url, creds):
414- if url.startswith("http://") or url.startswith("https://"):
415- cfg_str = urllib2.urlopen(urllib2.Request(url=url))
416- else:
417- if url.startswith("file://"):
418- url = url[7:]
419- cfg_str = open(url,"r").read()
420-
421- cfg = yaml.safe_load(cfg_str)
422-
423- # Support reading cloud-init config for MAAS datasource.
424- if 'datasource' in cfg:
425- cfg = cfg['datasource']['MAAS']
426-
427- for key in creds.keys():
428- if key in cfg and creds[key] == None:
429- creds[key] = cfg[key]
430-
431-def fail(msg):
432- sys.stderr.write("FAIL: %s" % msg)
433- sys.exit(1)
434-
435-
436-def main():
437- """
438- Call with single argument of directory or http or https url.
439- If url is given additional arguments are allowed, which will be
440- interpreted as consumer_key, token_key, token_secret, consumer_secret.
441- """
442- import argparse
443- import pprint
444-
445- parser = argparse.ArgumentParser(
446- description='Send signal operation and optionally post files to MAAS')
447- parser.add_argument("--config", metavar="file",
448- help="Specify config file", default=None)
449- parser.add_argument("--ckey", metavar="key",
450- help="The consumer key to auth with", default=None)
451- parser.add_argument("--tkey", metavar="key",
452- help="The token key to auth with", default=None)
453- parser.add_argument("--csec", metavar="secret",
454- help="The consumer secret (likely '')", default="")
455- parser.add_argument("--tsec", metavar="secret",
456- help="The token secret to auth with", default=None)
457- parser.add_argument("--apiver", metavar="version",
458- help="The apiver to use ("" can be used)", default=MD_VERSION)
459- parser.add_argument("--url", metavar="url",
460- help="The data source to query", default=None)
461- parser.add_argument("--file", dest='files',
462- help="File to post", action='append', default=[])
463- parser.add_argument("--post", dest='posts',
464- help="name=value pairs to post", action='append', default=[])
465- parser.add_argument("--power-type", dest='power_type',
466- help="Power type.", choices=POWER_TYPES, default=None)
467- parser.add_argument("--power-parameters", dest='power_parms',
468- help="Power parameters.", default=None)
469-
470- parser.add_argument("status",
471- help="Status", choices=VALID_STATUS, action='store')
472- parser.add_argument("message", help="Optional message",
473- default="", nargs='?')
474-
475- args = parser.parse_args()
476-
477- creds = {'consumer_key': args.ckey, 'token_key': args.tkey,
478- 'token_secret': args.tsec, 'consumer_secret': args.csec,
479- 'metadata_url': args.url}
480-
481- if args.config:
482- read_config(args.config, creds)
483-
484- url = creds.get('metadata_url', None)
485- if not url:
486- fail("URL must be provided either in --url or in config\n")
487- url = "%s/%s/" % (url, args.apiver)
488-
489- params = {
490- "op": "signal",
491- "status": args.status,
492- "error": args.message}
493-
494- for ent in args.posts:
495- try:
496- (key, val) = ent.split("=", 2)
497- except ValueError:
498- sys.stderr.write("'%s' had no '='" % ent)
499- sys.exit(1)
500- params[key] = val
501-
502- if args.power_parms is not None:
503- params["power_type"] = args.power_type
504- power_parms = dict(
505- power_user=args.power_parms.split(",")[0],
506- power_pass=args.power_parms.split(",")[1],
507- power_address=args.power_parms.split(",")[2]
508- )
509- params["power_parameters"] = json.dumps(power_parms)
510-
511- files = {}
512- for fpath in args.files:
513- files[os.path.basename(fpath)] = open(fpath, "r")
514-
515- data, headers = encode_multipart_data(params, files)
516-
517- exc = None
518- msg = ""
519-
520- try:
521- payload = geturl(url, creds=creds, headers=headers, data=data)
522- if payload != "OK":
523- raise TypeError("Unexpected result from call: %s" % payload)
524- else:
525- msg = "Success"
526- except urllib2.HTTPError as exc:
527- msg = "http error [%s]" % exc.code
528- except urllib2.URLError as exc:
529- msg = "url error [%s]" % exc.reason
530- except socket.timeout as exc:
531- msg = "socket timeout [%s]" % exc
532- except TypeError as exc:
533- msg = exc.message
534- except Exception as exc:
535- msg = "unexpected error [%s]" % exc
536-
537- sys.stderr.write("%s\n" % msg)
538- sys.exit((exc is None))
539-
540-if __name__ == '__main__':
541- main()
542
543=== removed directory 'sbin'
544=== removed file 'sbin/maas-ipmi-autodetect'
545--- sbin/maas-ipmi-autodetect 2012-10-09 18:21:02 +0000
546+++ sbin/maas-ipmi-autodetect 1970-01-01 00:00:00 +0000
547@@ -1,107 +0,0 @@
548-#!/usr/bin/python
549-import os
550-import commands
551-import re
552-import string
553-import random
554-import time
555-import json
556-
557-def detect_ipmi():
558- # TODO: Detection could be improved.
559- (status, output) = commands.getstatusoutput('ipmi-locate')
560- show_re = re.compile('(IPMI\ Version:) (\d\.\d)')
561- res = show_re.search(output)
562- if res == None:
563- return (False, "")
564- return (True, res.group(2))
565-
566-def is_ipmi_dhcp():
567- (status, output) = commands.getstatusoutput('bmc-config --checkout --key-pair="Lan_Conf:IP_Address_Source"')
568- show_re = re.compile('IP_Address_Source\s+Use_DHCP')
569- res = show_re.search(output)
570- if res == None:
571- return False
572- return True
573-
574-def set_ipmi_network_source(source):
575- (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="Lan_Conf:IP_Address_Source=%s"' % source)
576-
577-def get_ipmi_ip_address():
578- (status, output) = commands.getstatusoutput('bmc-config --checkout --key-pair="Lan_Conf:IP_Address"')
579- show_re = re.compile('([0-9]{1,3}[.]?){4}')
580- res = show_re.search(output)
581- return res.group()
582-
583-def commit_ipmi_user_settings(user, password):
584- (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User3:Username=%s"' % user)
585- (status, output) = commands.getstatusoutput('bmc-config --commit --key-pair="User3:Password=%s"' % password)
586-
587-def commit_ipmi_settings(config):
588- (status, output) = commands.getstatusoutput('bmc-config --commit --filename %s' % config)
589-
590-def get_maas_power_settings(user, password, ipaddress):
591- return "%s,%s,%s" % (user, password, ipaddress)
592-
593-def get_maas_power_settings_json(user, password, ipaddress):
594- power_params = {"power_address": ipaddress, "power_pass": password, "power_user": user}
595- return json.dumps(power_params)
596-
597-def generate_random_password(min=8,max=15):
598- length=random.randint(min,max)
599- letters=string.ascii_letters+string.digits
600- return ''.join([random.choice(letters) for _ in range(length)])
601-
602-def main():
603-
604- import argparse
605-
606- parser = argparse.ArgumentParser(
607- description='send config file to modify IPMI settings with')
608- parser.add_argument("--configdir", metavar="folder",
609- help="specify config file directory", default=None)
610- parser.add_argument("--dhcp-if-static", action="store_true",
611- dest="dhcp", help="set network source to DHCP if Static", default=False)
612- parser.add_argument("--comission-creds", action="store_true",
613- dest="commission_creds", help="Create IPMI temporary credentials", default=False)
614-
615- args = parser.parse_args()
616-
617- # Check whether IPMI exists or not.
618- (status, ipmi_version) = detect_ipmi()
619- if status != True:
620- # if False, then failed to detect ipmi
621- exit(1)
622-
623- # Check whether IPMI is being set to DHCP. If it is not, and
624- # '--dhcp-if-static' has been passed, Set it to IPMI to DHCP.
625- if not is_ipmi_dhcp() and args.dhcp:
626- set_ipmi_network_source("Use_DHCP")
627- # allow IPMI 60 seconds to obtain an IP address
628- time.sleep(60)
629-
630- # create user/pass
631- if args.commission_creds:
632- IPMI_MAAS_USER="maas-commissioning"
633- else:
634- IPMI_MAAS_USER="maas"
635- IPMI_MAAS_PASSWORD=generate_random_password()
636-
637- # Configure IPMI user/password
638- commit_ipmi_user_settings(IPMI_MAAS_USER, IPMI_MAAS_PASSWORD)
639-
640- # Commit other IPMI settings
641- if args.configdir:
642- for file in os.listdir(args.configdir):
643- commit_ipmi_settings(os.path.join(args.configdir, file))
644-
645- # get the IP address
646- IPMI_IP_ADDRESS = get_ipmi_ip_address()
647-
648- if args.commission_creds:
649- print get_maas_power_settings_json(IPMI_MAAS_USER, IPMI_MAAS_PASSWORD, IPMI_IP_ADDRESS)
650- else:
651- print get_maas_power_settings(IPMI_MAAS_USER, IPMI_MAAS_PASSWORD, IPMI_IP_ADDRESS)
652-
653-if __name__ == '__main__':
654- main()

Subscribers

People subscribed via source and target branches