144 Commits

Author SHA1 Message Date
Takashi Kajinami
8d2a16958b Remove cfn-push-stats
This script can't be used in OpenStack since CloudWatch API was removed
from Heat multiple cycles ago[1].

[1] 6d55417f80384ead56e176beec9e2fc4eb162d61

Change-Id: I0ab73d3553b17485cc8fcf094377876226a4593d
2024-03-15 17:34:31 +09:00
Zane Bitter
d04bb529dc Fix pep8 errors with later versions of hacking
We are stuck on a very old version of hacking (0.8). In order to move
forward, we need to fix a bunch of things that flake8 will complain about.

Change-Id: If40ac29094b90c5bae63e7423061a190655f50a3
2018-07-18 16:35:03 -04:00
Swapnil Kulkarni (coolsvap)
5d62b178c3 Replace deprecated LOG.warn with LOG.warning
LOG.warn is deprecated. It still used in a few places.
Updated to non-deprecated LOG.warning.

Change-Id: I6e8df0e072448fbd4077c4e5d98b2986e9855489
Closes-Bug:#1508442
2016-03-11 13:09:24 +05:30
twm2016
7a604b2d5c Changed logger init and added verbose arg handling
Initialized logger with default value of NOTSET.

Added if statement to handle verbose argument and set the logger to
DEBUG.

Change-Id: I997b8b964dade013db265d088d00ccfdd6ab030e
Closes-Bug: #1269465
2016-03-01 11:27:59 -06:00
Anant Patil
2710bba2cb Convert all internal commands to list
Make all internal commands as list to avoid any possibility of command
line injection. Commands supplied as string are susceptible to
substitution.

All the internal commands are supplied as list to CommandRunner. As a
convention, all the commands must be given as list to subprocess except
the commands read from file, like in case of cfn hooks and commands
section in metadata.

Few internal commands require shell redirects and they will be
implemented in another patch.

Change-Id: Ifabaf44e341144bc85508dc05c76b1d83e41ae44
Partial-Bug: #1312246
2015-09-22 10:37:11 +05:30
Jenkins
c4c50583c8 Merge "Fix typos in cfn scripts" 2015-06-09 02:40:36 +00:00
tyagi
bd194f3f53 Fix typos in cfn scripts
Change-Id: Ie411a1d5229a89b545d949b79552c3f6d240783d
2015-06-04 01:12:13 -07:00
tyagi
791046046e Add --insecure/-k option to cfn-signal
cfn-signal will not work when heat-cfn-api server is configured
for the https. This patch will provide a option to make a insecure
request to the cfn server.

Change-Id: I9dcd53b40a389811e292c331ff625a8b5af827b7
Closes-Bug: 1460007
2015-06-04 01:06:04 -07:00
Simon Pasquier
4ece05a829 cfn-signal provides a unique default id
Unless the parameter is provided, cfn-signal will use the instance UUID
from the Nova metadata as the id sent back to the WaitCondition.
In case the Nova metadata isn't available, it will use the hostname as a
fallback.

Change-Id: I1e5847c7babd7c6295d8c3e21f6cfa110a9b3026
Closes-bug: 1223429
2014-02-18 18:14:12 +01:00
Steve Baker
a6db3e6c0e Log curl stderr on non-zero exit status
This helps with debugging signal connectivity issues

Change-Id: I686f832cea0a4b397499824936df18444c7c472c
Closes-Bug: #1273010
2014-01-27 13:53:28 +13:00
Simon Pasquier
3eef3a451c Fix logging in cfn-init and cfn-signal
logging.getLogger() was called with a wrong name in the cfn scripts. As
a result, the cfn_helper module logged everything to stderr.

Change-Id: I3447291b202887aa09b0f0cb01764708683e7821
Closes-Bug: #1269355
2014-01-15 16:35:04 +01:00
Simon Pasquier
63d70cd0ec Implement -k option for cfn-get-metadata
The -k argument can be a top-level key or a nested key in which case
the keys are separated by dots (eg "foo.bar"). In case a key contains a
dot character, it needs to be surrounded by single quotes (eg
"foo.'bar.1'.fred).
If the -k option is not provided, the command prints out the full
metadata structure as before.

Change-Id: Ib05d39672086001b83e8d7f56bc42cc4ba75751c
Fixes: bug #1183299
2013-09-10 15:56:25 +02:00
JUN JIE NAN
f40e4b783c Change cfn-signal option --exit to --exit-code
According cfn user guide, the long option of cfn-signal -e should be
--exit-code.

Fixes bug #1220080

Change-Id: Id4e9feefd387a744f5e933aa4e9ea8a6f6f02a7c
2013-09-06 09:43:24 +08:00
Steve Baker
28e9aac8d9 Use python 3 style print functions
Required to pass pep8 H233.

Change-Id: I136dd2aa9fa567208a2fe1660b7a9085fde2927e
2013-08-07 13:29:13 +12:00
Angus Salkeld
cfa33e160b Use the server tags for dimensions and make watch_name optional.
This allows us to stop creating templates with circular dependancies.

So we can change:
  cfn-push-stats --watch {Ref: TheAlarm}
to:
  cfn-push-stats

This makes it closer to AWS and actually better as users can add their
own dimensions via the tags.

Change-Id: I365ae57c2275a2d064075eb1b3e14aa1e418d1ee
2013-07-31 10:58:39 +10:00
Dirk Mueller
87e08b0b4b Add Flake8 checks for bin/cfn-* to Gating
Fix the Pep8/hacking/pyflakes warnings in bin/cfn-*.

Change-Id: Ie21b3909c80d33adc712c2f3c9494d0fdbd90608
2013-06-20 14:45:01 +02:00
JUN JIE NAN
70ec26e577 Add missing -d option in cfn-signal
Change-Id: I1d4f7f9a935d037e3b9f75f3b9627b2eaa560179
Fixes: bug #1192486
2013-06-19 16:21:08 +08:00
Simon Pasquier
2d00ede1e6 cfn-get-metadata: log metadata to standard output
Add display() method to the Metadata class that prints the metadata to
standard output if the metdata has been successfully retrieved (either
from local cache or from the remote server).

Change-Id: Idf6c1aecf2a5204d7cf7fbf3c8d826f750a72785
Fixes: bug #1183298
2013-06-03 14:21:40 +02:00
Steven Hardy
d5053e63ad Add options to send user-defined metric
This allows the user to specify an arbitrary metric in their
template, and send the number based on some data they can
generate, e.g for openshift node occupancy data

Change-Id: Iaa38614b8db3665f9fb340fd92b67b6f7a47b206
2013-05-24 17:33:29 +01:00
Clint Byrum
cc5a10baf2 cfn-hup : Moving erroneous print to use LOG.debug.
Change-Id: I6e567442cbc346b711b445c986095f1330131359
2013-05-08 12:50:24 -07:00
Steve Baker
009ed21038 Make help for --force more accurate
This aligns the help message with the man page.

Related to bug #1153851

Change-Id: Ifec6213494c6ceddcf213fd089e8cf99913d6c5d
2013-03-18 15:17:11 +13:00
Steven Hardy
6457f3ffe9 cfn-push-stats : Add --haproxy-latency option
The --haproxy options sends a variety of metrics to the engine,
which can only accept one metric per watchrule, so will discard
all except the one specified on the CloudWatch alarm, so add a
version which only sends the Latency metric (since that's what
we care about for the internal loadbalancer resource)

ref bug 1133510

Change-Id: I53084dcbf14c28028af6cba0b8125663fefc6483
2013-03-07 11:01:49 +00:00
Steve Baker
4dc88ac6ab Look for heat data files in /var/lib/heat-cfntools
The /var/lib/heat-cfntools directory should be owned by the
heat-cfntools package for whichever distro it is included.

This avoids the problem of heat writing to directories owned
by cloud-init.

This is the guest-side change which corresponds to this review
https://review.openstack.org/#/c/23052/

Fixes: Bug #1105806
2013-02-28 14:02:17 +13:00
Jeff Peeler
e65198dde8 Merge remote-tracking branch 'upstream/master'
Synced with heat-jeos repo
(Conflicted files below were simply dropped)

Conflicts:
	bin/heat-jeos
	docs/man/man1/heat-jeos.1
	heat_jeos/glance_clients.py
	heat_jeos/utils.py
2013-02-13 15:08:56 -05:00
Steve Baker
f542bcd24f Move logic to a couple of functions and parse args only in __main__ 2013-01-29 13:50:47 +11:00
Steve Baker
df270d935d Script to create cfn-* symlinks in /opt/aws/bin
Typical usage:
cfn-create-aws-symlinks --source=/usr/bin

This will create directory /opt/aws/bin if it does not exist, and then creates symlinks within that from the scripts /usr/bin/cfn-*.

By default, any existing /opt/aws/bin/cfn-* script will not be overwritten. This behaviour can be overridden with the flag --force
2013-01-28 12:08:21 +11:00
Robert van Leeuwen
2336b5d42b Exception handling and auto_file variable fix 2013-01-18 16:23:45 +01:00
Robert van Leeuwen
b5018d16bc fix some pep issues and remove tempfile auto patch 2013-01-18 15:37:13 +01:00
Robert van Leeuwen
9c164bb686 fix tab/space issue 2013-01-18 14:18:33 +01:00
Robert van Leeuwen
f098e9c8d7 Add commandline support for custom autofiles e.g. kickstart 2013-01-18 14:04:50 +01:00
Steve Baker
d8a6d6e741 Always import cfn_helper from heat_cfntools.cfntools 2012-12-28 10:14:12 +13:00
Steve Baker
2f412a364a rename python package heat_jeos to heat_cfntools 2012-12-24 17:07:35 +13:00
Steve Baker
1a15f6fd8d Reorganise project to contain stand-alone heat-cfntools 2012-12-21 09:20:49 +13:00
Tomas Sedovic
f25d37d888 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>
2012-10-12 17:35:26 +02:00
Tomas Sedovic
39401324d5 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>
2012-10-12 16:48:53 +02:00
Tomas Sedovic
3cbc4bffd4 Decide image_type based on the template contents
To figure out whether to include cfntools in the image, heat-jeos used
to look at the template filename.

Now it uses a more flexible solution: if the template has the
'files/file' declaration for each of the cfntools file, it's contenst
will be included.

Fixes #10

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-08-30 13:06:21 +02:00
Tomas Sedovic
aba3d890d0 Move image related code to heat_jeos.utils
ref #15

This allows other tools (such as heat-prebuild) to build images using
heat-jeos.

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-08-28 15:32:27 +02:00
Tomas Sedovic
7c23d34723 Don't write the processed template to filesystem
All the template processing and image building now passes around a
string representation of the TDL XML instead of writing it out to
/tmp/tdl and then reading it again.

This ensures that the template is not manipulated outside of heat-jeos
and provides greater modularity.

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-08-22 17:17:42 +02:00
Jeff Peeler
f520f2c4d6 Whitespace fix
Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-08-18 01:37:21 -04:00
Jeff Peeler
51469d80e0 Set instance type from JEOS name
Removed --gold option since it is no longer required.

Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-08-18 01:36:47 -04:00
Jeff Peeler
1be3d4e481 Change glance registration instructions
The container format for the generated image should be bare, not OVF.
This change also matches the container format used with
--register-with-glance.

Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-08-15 18:15:05 -04:00
Tomas Sedovic
b717a7422d Remove the '-jeos' suffix from all TDL names
Fixes #16

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-08-14 16:46:56 +02:00
Tomas Sedovic
fc24b64ab5 Make heat-jeos list Ubuntu-compatible
Ubuntu 12.04 ships with a newer version of prettytable (which we use to display the heat-list output) than Fedora 17.

The column alignment formatting API changed between the version. This change makes sure the proper call is used.
2012-07-31 13:17:55 +03:00
Zane Bitter
59eac1c0ca Fix use-before-assign error 2012-07-12 11:28:21 -04:00
Tomas Sedovic
72ce5af925 Check for Glance creds before building the jeos
Fixes #7
2012-07-11 12:06:00 +02:00
Tomas Sedovic
7b51f55e7e Fix empty cfntools in generated images
Fixes issue #11
2012-07-10 18:09:34 +02:00
Tomas Sedovic
4056d55fce Add manpage
Fixes issue #4

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-07-10 16:49:20 +02:00
Tomas Sedovic
42e978f3ec Improve the heat-jeos usability
Fixes issues #2 and #3

We'll use only two commands: `list` and `create`.

`list` displays the bundled Oz templates and `create` builds the JEOS and
optionally registers it with Glance.

The OS metadata (distro, arch, version) are no longer passed as the cli
arguments. ISO location is read from the template.

The user can pass their own custom template.

Signed-off-by: Tomas Sedovic <tomas@sedovic.cz>
2012-07-10 16:49:20 +02:00
Steven Dake
398e510dec Build gold image - was previously broken
Patch work form Patricka Petit

Signed-off-by: Steven Dake <sdake@redhat.com>
2012-06-28 07:52:52 -07:00
Jeff Peeler
cdaaf367e0 Bump ubuntu iso version and some clean up
Specifically bump iso 10.04-3 to 10.04-4 (current release). Also fix
not displaying the error message on a jeos creation failure.

Signed-off-by: Jeff Peeler <jpeeler@redhat.com>
2012-06-22 17:14:01 -04:00