-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmock.py
More file actions
60 lines (35 loc) · 1.17 KB
/
mock.py
File metadata and controls
60 lines (35 loc) · 1.17 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
from __future__ import unicode_literals
import json
import os
from deis import settings
def bootstrap_node(node):
return '', 0
def converge_node(node):
return '', 0
def run_node(node, command):
return '', 0
def purge_node(node):
return
def publish_user(user, data):
path = os.path.join(settings.TEMPDIR, 'user-{username}'.format(**user))
with open(path, 'w') as f:
f.write(json.dumps(data))
def purge_user(user):
path = os.path.join(settings.TEMPDIR, 'user-{username}'.format(**user))
os.remove(path)
def publish_app(app, data):
path = os.path.join(settings.TEMPDIR, 'app-{id}'.format(**app))
with open(path, 'w') as f:
f.write(json.dumps(data))
def purge_app(app):
path = os.path.join(settings.TEMPDIR, 'app-{id}'.format(**app))
os.remove(path)
def publish_formation(formation, data):
path = os.path.join(settings.TEMPDIR, 'formation-{id}'.format(**formation))
with open(path, 'w') as f:
f.write(json.dumps(data))
def purge_formation(formation):
path = os.path.join(settings.TEMPDIR, 'formation-{id}'.format(**formation))
os.remove(path)
def converge_controller():
return None