forked from admiyo/ossipee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ossipee-host
executable file
·31 lines (23 loc) · 952 Bytes
/
ossipee-host
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python
import logging
import ossipee
logging.basicConfig(level=logging.INFO)
class App(ossipee.Application):
description = 'Add a new host to the current plan.'
def get_parser(self):
parser = super(App, self).get_parser()
parser.add_argument('host', nargs='?', default='deleteme',
help='New Host to add"')
return parser
def create_host(self):
self.plan.add_host(self.args.host)
self.build_work_item_list([
lambda session, plan: ossipee.NovaServer(session,
plan,
self.args.host),
lambda session, plan: ossipee.FloatIP(session,
plan,
self.args.host),
ossipee.Inventory
]).create()
App().create_host()