Skip to content

Commit a49257c

Browse files
committed
Added scripts
1 parent 043f506 commit a49257c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

scripts/get_linode_image_id.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import json
2+
3+
def query_linode_image_id():
4+
""" Query for linode image id and write to proxy.conf """
5+
6+
image_id = raw_input('Enter linode image id: ')
7+
try:
8+
im_id = int(image_id)
9+
cfg = json.load(open('proxy.conf'))
10+
cfg['image_id'] = im_id
11+
json.dump(cfg, open('proxy.conf','w'), indent=4)
12+
except ValueError, e:
13+
print 'Invalid image id=>',image_id
14+
except Exception, e:
15+
print 'Error updating proxy.conf =>',e
16+
17+
if __name__ == "__main__":
18+
query_linode_image_id()

0 commit comments

Comments
 (0)