-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmock.py
More file actions
65 lines (46 loc) · 1.41 KB
/
mock.py
File metadata and controls
65 lines (46 loc) · 1.41 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""
Deis mock cloud provider implementation for testing.
"""
from __future__ import unicode_literals
def seed_flavors():
"""
Seed the database with default flavors for the mock provider.
:rtype: list of dicts containing flavor data
"""
flavors = []
for r in ('east', 'west'):
flavors.append({'id': 'mock-{}'.format(r),
'provider': 'mock',
'params': '{}'})
return flavors
def build_layer(layer):
"""
Build a layer.
This function is a no-op for the mock provider.
:param layer: a dict containing formation, id, params, and creds info
"""
return
def destroy_layer(layer):
"""
Destroy a layer.
This function is a no-op for the mock provider.
:param layer: a dict containing formation, id, params, and creds info
"""
return
def build_node(node):
"""
Build a node.
:param node: a dict containing formation, layer, params, and creds info.
:rtype: a tuple of (provider_id, fully_qualified_domain_name, metadata)
"""
provider_id = 'i-1234567'
fqdn = node.get('fqdn') or 'localhost.localdomain.local'
metadata = {'state': 'running'}
return provider_id, fqdn, metadata
def destroy_node(node):
"""
Destroy a node.
This function is a no-op for the mock provider.
:param node: a dict containing a node's provider_id, params, and creds
"""
return