Skip to content

Commit f8eff73

Browse files
committed
Merge pull request #19 from awslabs/develop
Merging develop to release v0.0.16
2 parents 642149d + ef41f7a commit f8eff73

File tree

9 files changed

+925
-14
lines changed

9 files changed

+925
-14
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
CHANGELOG
33
=========
44

5+
0.0.16
6+
======
7+
* feature:``cfncluster``: Support for GovCloud region
8+
* updates:``cli``: Improved error messages parsing config file
9+
510
0.0.15
611
======
712

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ everything is done using CloudFormation or resources within AWS.
88

99
### Installation
1010

11-
The current working version is cfncluster-0.0.15. The CLI is written in python and uses BOTO for AWS actions. You can install the CLI with the following command:
11+
The current working version is cfncluster-0.0.16. The CLI is written in python and uses BOTO for AWS actions. You can install the CLI with the following command:
1212

1313
#### Linux/OSX
1414

cli/cfncluster/cfnconfig.py

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,14 @@ def __init__(self, args):
113113
try:
114114
self.key_name = __config.get(self.__cluster_section, 'key_name')
115115
if not self.key_name:
116-
raise Exception
116+
print("ERROR: key_name set in [%s] section but not defined." % self.__cluster_section)
117+
sys.exit(1)
117118
if self.__sanity_check:
118119
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
119120
'EC2KeyPair', self.key_name)
120121
except ConfigParser.NoOptionError:
121-
raise Exception
122+
print("ERROR: Missing key_name option in [%s] section." % self.__cluster_section)
123+
sys.exit(1)
122124
self.parameters.append(('KeyName', self.key_name))
123125

124126
# Determine the CloudFormation URL to be used
@@ -130,15 +132,21 @@ def __init__(self, args):
130132
self.template_url = __config.get(self.__cluster_section,
131133
'template_url')
132134
if not self.template_url:
133-
raise Exception
135+
print("ERROR: template_url set in [%s] section but not defined." % self.__cluster_section)
136+
sys.exit(1)
134137
if self.__sanity_check:
135138
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
136139
'URL', self.template_url)
137140
except ConfigParser.NoOptionError:
138141
if self.region == 'eu-central-1':
139-
self.template_url = ('https://s3.%s.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json' % (self.region, self.region, self.version))
142+
self.template_url = ('https://s3.%s.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json'
143+
% (self.region, self.region, self.version))
144+
elif self.region == 'us-gov-west-1':
145+
self.template_url = ('https://s3-%s.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json'
146+
% (self.region, self.region, self.version))
140147
else:
141-
self.template_url = ('https://s3.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json' % (self.region, self.version))
148+
self.template_url = ('https://s3.amazonaws.com/cfncluster-%s/templates/cfncluster-%s.cfn.json'
149+
% (self.region, self.version))
142150
except AttributeError:
143151
pass
144152

@@ -149,15 +157,18 @@ def __init__(self, args):
149157
# Dictionary list of all VPC options
150158
self.__vpc_options = dict(vpc_id=('VPCId','VPC'), master_subnet_id=('MasterSubnetId', 'VPCSubnet'),
151159
compute_subnet_cidr=('ComputeSubnetCidr',None),
152-
compute_subnet_id=('ComputeSubnetId', 'VPCSubnet'), use_public_ips=('UsePublicIps', None),
160+
compute_subnet_id=('ComputeSubnetId', 'VPCSubnet'), use_public_ips=('UsePublicIps',
161+
None),
153162
ssh_from=('SSHFrom', None))
154163

155164
# Loop over all VPC options and add define to parameters, raise Exception is defined but null
156165
for key in self.__vpc_options:
157166
try:
158167
__temp__ = __config.get(self.__vpc_section, key)
159168
if not __temp__:
160-
raise Exception
169+
print("ERROR: %s defined but not set in [%s] section"
170+
% (key, self.__vpc_section))
171+
sys.exit(1)
161172
if self.__sanity_check and self.__vpc_options.get(key)[1] is not None:
162173
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
163174
self.__vpc_options.get(key)[1],__temp__)
@@ -182,7 +193,9 @@ def __init__(self, args):
182193
try:
183194
__temp__ = __config.get(self.__cluster_section, key)
184195
if not __temp__:
185-
raise Exception
196+
print("ERROR: %s defined but not set in [%s] section"
197+
% (key, self.__cluster_section))
198+
sys.exit(1)
186199
if self.__sanity_check and self.__cluster_options.get(key)[1] is not None:
187200
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
188201
self.__cluster_options.get(key)[1],__temp__)
@@ -194,7 +207,9 @@ def __init__(self, args):
194207
try:
195208
self.__ebs_settings = __config.get(self.__cluster_section, 'ebs_settings')
196209
if not self.__ebs_settings:
197-
raise Exception
210+
print("ERROR: ebs_settings defined by not set in [%s] section"
211+
% self.__cluster_section)
212+
sys.exit(1)
198213
self.__ebs_section = ('ebs %s' % self.__ebs_settings)
199214
except ConfigParser.NoOptionError:
200215
pass
@@ -210,7 +225,9 @@ def __init__(self, args):
210225
try:
211226
__temp__ = __config.get(self.__ebs_section, key)
212227
if not __temp__:
213-
raise Exception
228+
print("ERROR: %s defined but not set in [%s] section"
229+
% (key, self.__ebs_section))
230+
sys.exit(1)
214231
if self.__sanity_check and self.__ebs_options.get(key)[1] is not None:
215232
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
216233
self.__ebs_options.get(key)[1],__temp__)
@@ -224,7 +241,9 @@ def __init__(self, args):
224241
try:
225242
self.__scaling_settings = __config.get(self.__cluster_section, 'scaling_settings')
226243
if not self.__scaling_settings:
227-
raise Exception
244+
print("ERROR: scaling_settings defined by not set in [%s] section"
245+
% self.__cluster_section)
246+
sys.exit(1)
228247
self.__scaling_section = ('scaling %s' % self.__scaling_settings)
229248
except ConfigParser.NoOptionError:
230249
pass
@@ -241,7 +260,9 @@ def __init__(self, args):
241260
try:
242261
__temp__ = __config.get(self.__scaling_section, key)
243262
if not __temp__:
244-
raise Exception
263+
print("ERROR: %s defined but not set in [%s] section"
264+
% (key, self.__scaling_section))
265+
sys.exit(1)
245266
if self.__sanity_check and self.__scaling_options.get(key)[1] is not None:
246267
config_sanity.check_resource(self.region,self.aws_access_key_id, self.aws_secret_access_key,
247268
self.__scaling_options.get(key)[1],__temp__)

cli/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def read(fname):
2020
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2121

2222
console_scripts = ['cfncluster = cfncluster.cli:main']
23-
version = "0.0.15"
23+
version = "0.0.16"
2424
requires = ['boto>=2.34']
2525

2626
if sys.version_info[:2] == (2, 6):

docs/Makefile

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
PAPER =
8+
BUILDDIR = build
9+
10+
# User-friendly check for sphinx-build
11+
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
12+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
13+
endif
14+
15+
# Internal variables.
16+
PAPEROPT_a4 = -D latex_paper_size=a4
17+
PAPEROPT_letter = -D latex_paper_size=letter
18+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
19+
# the i18n builder cannot share the environment and doctrees with the others
20+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
21+
22+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
23+
24+
help:
25+
@echo "Please use \`make <target>' where <target> is one of"
26+
@echo " html to make standalone HTML files"
27+
@echo " dirhtml to make HTML files named index.html in directories"
28+
@echo " singlehtml to make a single large HTML file"
29+
@echo " pickle to make pickle files"
30+
@echo " json to make JSON files"
31+
@echo " htmlhelp to make HTML files and a HTML help project"
32+
@echo " qthelp to make HTML files and a qthelp project"
33+
@echo " devhelp to make HTML files and a Devhelp project"
34+
@echo " epub to make an epub"
35+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
37+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38+
@echo " text to make text files"
39+
@echo " man to make manual pages"
40+
@echo " texinfo to make Texinfo files"
41+
@echo " info to make Texinfo files and run them through makeinfo"
42+
@echo " gettext to make PO message catalogs"
43+
@echo " changes to make an overview of all changed/added/deprecated items"
44+
@echo " xml to make Docutils-native XML files"
45+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
46+
@echo " linkcheck to check all external links for integrity"
47+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
48+
49+
clean:
50+
rm -rf $(BUILDDIR)/*
51+
52+
html:
53+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
54+
@echo
55+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
56+
57+
dirhtml:
58+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
59+
@echo
60+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
61+
62+
singlehtml:
63+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
64+
@echo
65+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
66+
67+
pickle:
68+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
69+
@echo
70+
@echo "Build finished; now you can process the pickle files."
71+
72+
json:
73+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
74+
@echo
75+
@echo "Build finished; now you can process the JSON files."
76+
77+
htmlhelp:
78+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
79+
@echo
80+
@echo "Build finished; now you can run HTML Help Workshop with the" \
81+
".hhp project file in $(BUILDDIR)/htmlhelp."
82+
83+
qthelp:
84+
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
85+
@echo
86+
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
87+
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/cfncluster.qhcp"
89+
@echo "To view the help file:"
90+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/cfncluster.qhc"
91+
92+
devhelp:
93+
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
94+
@echo
95+
@echo "Build finished."
96+
@echo "To view the help file:"
97+
@echo "# mkdir -p $$HOME/.local/share/devhelp/cfncluster"
98+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/cfncluster"
99+
@echo "# devhelp"
100+
101+
epub:
102+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
103+
@echo
104+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
105+
106+
latex:
107+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108+
@echo
109+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
110+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
111+
"(use \`make latexpdf' here to do that automatically)."
112+
113+
latexpdf:
114+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115+
@echo "Running LaTeX files through pdflatex..."
116+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
117+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118+
119+
latexpdfja:
120+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121+
@echo "Running LaTeX files through platex and dvipdfmx..."
122+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
123+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124+
125+
text:
126+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127+
@echo
128+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
129+
130+
man:
131+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132+
@echo
133+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134+
135+
texinfo:
136+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137+
@echo
138+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139+
@echo "Run \`make' in that directory to run these through makeinfo" \
140+
"(use \`make info' here to do that automatically)."
141+
142+
info:
143+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144+
@echo "Running Texinfo files through makeinfo..."
145+
make -C $(BUILDDIR)/texinfo info
146+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147+
148+
gettext:
149+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150+
@echo
151+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152+
153+
changes:
154+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155+
@echo
156+
@echo "The overview file is in $(BUILDDIR)/changes."
157+
158+
linkcheck:
159+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160+
@echo
161+
@echo "Link check complete; look for any errors in the above output " \
162+
"or in $(BUILDDIR)/linkcheck/output.txt."
163+
164+
doctest:
165+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166+
@echo "Testing of doctests in the sources finished, look at the " \
167+
"results in $(BUILDDIR)/doctest/output.txt."
168+
169+
xml:
170+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
171+
@echo
172+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
173+
174+
pseudoxml:
175+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
176+
@echo
177+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

0 commit comments

Comments
 (0)