add setup.py to heat-jeos command

Signed-off-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Steven Dake 2012-06-05 16:07:21 -07:00
parent 41c4f5df10
commit 3fe50d72e1
20 changed files with 62 additions and 10 deletions

View File

@ -1,12 +1,7 @@
include AUTHORS
include ChangeLog
include HACKING.rst
include LICENSE
include README.rst
include MANIFEST.in pylintrc
include openstack-common.conf
include babel.cfg
graft templates
include heat/jeos/F16-i386-gold-jeos.tdl
include heat/jeos/F17-i386-gold-jeos.tdl
include heat/jeos/F16-i386-cfntools-jeos.tdl
@ -23,6 +18,3 @@ include heat/cfntools/cfn-get-metadata
include heat/cfntools/cfn-push-stats
include heat/cloudinit/config
include heat/cloudinit/part-handler.py
include heat/db/sqlalchemy/migrate_repo/migrate.cfg
graft etc
graft docs

View File

@ -34,6 +34,25 @@ import time
from glance.common import exception
from glance import client as glance_client
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
jeos_path = ''
cfntools_path = ''
if os.path.exists(os.path.join(possible_topdir, 'heat_jeos', '__init__.py')):
sys.path.insert(0, possible_topdir)
jeos_path = '%s/heat/%s/' % (possible_topdir, "jeos")
cfntools_path = '%s/heat/%s/' % (possible_topdir, "cfntools")
jeos_path = os.path.join(possible_topdir, 'jeos')
cfntools_path = os.path.join(possible_topdir, 'cfntools')
else:
for p in sys.path:
jeos_path = os.path.join(p, 'heat', 'jeos')
cfntools_path = os.path.join(p, 'heat', 'cfntools')
if os.access(jeos_path, os.R_OK):
break
# TODO(shadower): split the options to TDL/image/glance
# TODO(shadower): use Oz as a library, don't shell out
@ -127,7 +146,7 @@ def command_all(options, arguments):
sys.exit(1)
tdl_file = '%s-%s-%s-jeos.tdl' % (distro, arch, instance_type)
tdl_path = os.path.join(options.jeos_dir, tdl_file)
tdl_path = os.path.join(jeos_path, tdl_file)
if options.debug:
print "Using tdl: %s" % tdl_path
@ -138,7 +157,7 @@ def command_all(options, arguments):
cfn_tools = ['cfn-init', 'cfn-hup', 'cfn-signal',
'cfn-get-metadata', 'cfn_helper.py', 'cfn-push-stats']
for cfnname in cfn_tools:
f = open('%s/%s' % (options.cfn_dir, cfnname), 'r')
f = open('%s/%s' % (cfntools_path, cfnname), 'r')
cfscript_e64 = base64.b64encode(f.read())
f.close()
cfnpath = "/template/files/file[@name='/opt/aws/bin/%s']" % cfnname

41
setup.py Executable file
View File

@ -0,0 +1,41 @@
#!/usr/bin/python
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import gettext
import os
import subprocess
import setuptools
setuptools.setup(
name='heat_jeos',
version='1',
description='The heat-jeos project provides services for creating '
'(J)ust (E)nough (O)perating (S)ystem images',
license='Apache License (2.0)',
author='Heat API Developers',
author_email='discuss@heat-api.org',
url='http://heat-api.org.org/',
packages=setuptools.find_packages(exclude=['bin']),
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.6',
'Environment :: No Input/Output (Daemon)',
],
scripts=['bin/heat-jeos'],
py_modules=[])