annotate change_vagrantfile.py @ 30:2888c7ec9013

can't define vm name is not number.
author taiki <taiki@cr.ie.u-ryukyu.ac.jp>
date Tue, 02 Sep 2014 08:10:27 -1000
parents f194adc597b6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
1 #!/usr/bin/python
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
2 # -*- encoding: utf-8 -*-
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
3
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
4 import sys,os
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
5
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
6 FILE = "Vagrantfile"
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
7
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
8 if not os.path.exists(FILE):
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
9 print(FILE + ":file not found.")
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
10 sys.exit(1)
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
11
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
12 f = open(FILE)
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
13
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
14 file_tmp = []
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
15 for line in f:
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
16 file_tmp.append(line)
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
17
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
18 for l in file_tmp:
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
19 if 'config.vm.network :private_network' in l:
f194adc597b6 add source to edit vagrantfile.
taiki
parents:
diff changeset
20