Add support for Folsom's python-glanceclient

Fixes #20

Heat supports both Essex and Folsom for now. However, in Folsom, the use
of python-glance client is deprecated in favor of python-glanceclient.

Since the clients are incompatible, this adds the `heat.glance_client`
package that abstracts the differences away.

Once we stop supporting Essex, most of this should go away.

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
Don't load the glance when it's not needed

Fixes #13

If the user doesn't specify the --register-with-glance option, the
python-glance or python-glanceclient library should not be needed.

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
Inject template boto.cfg for cfntools

new cfn-push-stats uses boto to connect to the heat
CloudWatch server, so we create a template boto.cfg
which then needs to be sedded in the instance template
so that the gateway IP/hostname is specified

Ref #21

Signed-off-by: Steven Hardy <shardy@redhat.com>
Add boto to Fedora cfntools tdls

New version of cfn-push-stats requires boto, so add
boto package and config to the tdls

Ref #21

Signed-off-by: Steven Hardy <shardy@redhat.com>
heat-jeos : convert cfn-push-stats to use CloudWatch API

Covert cfn-push-stats to send metric data via the heat CloudWatch API, we
use the boto client library, which simplifies client connection to the
API.

Note this means all instances using cloudwatch/cfn-push-stats must now
create /etc/boto.cfg and /etc/cfn/cfn-credentials (populated with keys
from AWS::IAM::User and AWS::IAM::AccessKey), see HA template for
example.

Fixes #21

Signed-off-by: Steven Hardy <shardy@redhat.com>
Fix image lookup by name on Folsom

Fixes #27

Signed-off-by: Zane Bitter <zbitter@redhat.com>
Bump version to 7

Signed-off-by: Zane Bitter <zbitter@redhat.com>
cfn-hup fix logging to file

Fixup logging configuration so cfn-hup log output goes to
/var/log/cfn-hup.log

Fixes #26

Signed-off-by: Steven Hardy <shardy@redhat.com>
heat-jeos : convert cfn-hup to use CloudFormation API

Covert cfn-hup to read resource metadata via the heat CloudFormation API
We use the boto client library, which simplifies client connection to the
API.

Note this means all instances using cfn-hup must now
create /etc/boto.cfg and /etc/cfn/cfn-credentials (populated with keys
from AWS::IAM::User and AWS::IAM::AccessKey), see HA template for
example.

Fixes #25

Signed-off-by: Steven Hardy <shardy@redhat.com>
Fix permissions on /tmp/last_metadata

Ensure cfn_helper.py chmods the temporary metadata to
avoid exposing credentials and other sensitive information
in a world-readable file

Fixes #24

Signed-off-by: Steven Hardy <shardy@redhat.com>
Add boto to openshift cfntools tdl

New version of cfn-push-stats and cfn-hup requires boto, so add boto package
and config to the tdl

Signed-off-by: Steven Hardy <shardy@redhat.com>
set boto BOTO_CONFIG variable to use specified config file

Set BOTO_CONFIG for cfntools which use boto, this means we can create a
boto config which is deployed via cloud-init with no sedding etc needed
so cfn-init can connect to the cfn api for metadata if required.

Ref #33

Signed-off-by: Steven Hardy <shardy@redhat.com>
Remove boto.cfg template

Remove the template boto.cfg from templates, and logic to inject it,
boto config file is now deployed via cloud-init so this is no longer
needed

Ref #33

Signed-off-by: Steven Hardy <shardy@redhat.com>
cfn_helper Metadata fallback to files if getting remote metadata fails

We need to fall back to local files when retrieval of remote metadata
fails, for example when we do not have any local credentials yet (as
they are in the cloud-init deployed metadata).

This patch tries to retrieve data from the following locations (in this
order):
- Remote metadata from CFN API
- Local saved remote metadata (/tmp/last_metadata)
- Local cloud-init intial metadata (/var/lib/cloud/data/cfn-init-data)

This should hopefully mean both cfn-init and cfn-hup now work as required

Fixes #33

Signed-off-by: Steven Hardy <shardy@redhat.com>
cfn_helper turn off boto debugging

Turn off boto debugging to reduce noise in the logs

Fixes #32

Signed-off-by: Steven Hardy <shardy@redhat.com>
Fix some imports and return code

Cfntools no longer are in the heat repo. Modify cfn-signal to exit with
a return code that accurately reflects the curl request.

closes #30

Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
cfn-signal URL must be quoted

The curl request URL must be quoted in cfn-signal for the request to
succeed when using pre-signed URLs

blueprint metsrv-remove
Signed-off-by: Steven Hardy <shardy@redhat.com>
Make registration with python-glanceclient work

In the Folsom Glance client code, we lookup the endpoint for the client
in the Keystone service catalog. However this endpoint includes the API
version "/v1", while the glance client is expecting the endpoint
*without* the version part.

Fixes #35

Signed-off-by: Zane Bitter <zbitter@redhat.com>
Add commandline support for custom autofiles e.g. kickstart
fix tab/space issue