bug 6368: add cloud-cli rpm for cloudvoladm

Actually, it's a general CLI, can access all the CloudStack APIs
This commit is contained in:
edison 2010-10-09 02:07:52 -07:00
parent 33d69b1746
commit 2100187dcd
3 changed files with 43 additions and 14 deletions

View File

@ -296,6 +296,14 @@ Group: System Environment/Libraries
The Cloud.com usage monitor provides usage accounting across the entire cloud for
cloud operators to charge based on usage parameters.
%package cloud-cli
Summary: Cloud.com command line tools
Requires: python
Group: System Environment/Libraries
%description cloud-cli
The Cloud.com command line tools contain a few Python modules that can call cloudStack APIs.
%endif
%prep
@ -539,7 +547,9 @@ fi
%files python
%defattr(0644,root,root,0755)
%{_prefix}/lib*/python*/site-packages/%{name}*
%{_prefix}/lib*/python*/site-packages/%{name}_PrettyPrint.*
%{_prefix}/lib*/python*/site-packages/%{name}_sxp.*
%{_prefix}/lib*/python*/site-packages/%{name}_utils.*
%doc README
%doc HACKING
%doc debian/copyright
@ -699,6 +709,18 @@ fi
%doc HACKING
%doc debian/copyright
%files cloud-cli
%{_bindir}/%{name}-tool
%{_bindir}/%{name}voladm
%{_sysconfdir}/%{name}/cli/commands.xml
%dir %{_prefix}/lib*/python*/site-packages/%{name}tool
%dir %{_prefix}/lib*/python*/site-packages/%{name}apis
%{_prefix}/lib*/python*/site-packages/%{name}tool/*
%{_prefix}/lib*/python*/site-packages/%{name}apis/*
%doc README
%doc HACKING
%doc debian/copyright
%endif
%changelog

View File

@ -195,7 +195,7 @@ for src,tgt,inst in zip(src_files,subst_files,inst_files):
tgen = bld(features='subst', name='patchsubst', source=src, target=tgt)
tgen.dict = bld.env.get_merged_dict()
bld.path.find_or_declare(tgt)
# this is a clever little thing
# given a list of nodes, build or source
# construct a tar file containing them
@ -609,16 +609,21 @@ def generate_xml_api_description(task):
ret = Utils.exec_command(["java","-cp",cp,"com.cloud.utils.commandlinetool.BuildCommandLineInputFile"]+arguments,log=True)
return ret
props = " client/tomcatconf/commands.properties"
if buildpremium: props += " cloudstack-proprietary/premium/tomcatconf/commands-ext.properties"
jarnames = ['utils','server','core']
if buildpremium: jarnames += ['server-extras']
tgen = bld(
rule = generate_xml_api_description,
source = " ".join( [ 'target/jar/cloud-%s.jar'%x for x in jarnames ] ) + props,
target = 'commands.xml',
name = 'xmlapi',
after = 'runant',
)
bld.process_after(tgen)
if buildpremium:
props = " client/tomcatconf/commands.properties"
props += " cloudstack-proprietary/premium/tomcatconf/commands-ext.properties"
jarnames = ['utils','server','core']
jarnames += ['server-extras']
tgen = bld(
rule = generate_xml_api_description,
source = " ".join( [ 'target/jar/cloud-%s.jar'%x for x in jarnames ] ) + props,
target = 'commands.xml',
name = 'xmlapi',
after = 'runant',
install_path="${CLIDIR}"
)
bld.process_after(tgen)
bld.install_files("${PYTHONDIR}//cloudtool", 'cloudstack-proprietary/cloud-cli/cloudtool/*')
bld.install_files("${PYTHONDIR}/cloudapis", 'cloudstack-proprietary/cloud-cli/cloudapis/*')

View File

@ -151,6 +151,7 @@ else:
conf.check_message_2("%s (assumed presence of Tomcat there)"%conf.env.TOMCATHOME,"GREEN")
conf.env.AGENTPATH = _join(conf.env.PACKAGE,"agent")
conf.env.CLIPATH = _join(conf.env.PACKAGE,"cli")
conf.env.CPPATH = _join(conf.env.PACKAGE,"console-proxy")
conf.env.MSPATH = _join(conf.env.PACKAGE,"management")
conf.env.USAGEPATH = _join(conf.env.PACKAGE,"usage")
@ -255,6 +256,7 @@ conf.env.USAGESYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${USAGEPATH}"
conf.env.CPLIBDIR = Utils.subst_vars(_join("${LIBDIR}","${CPPATH}"),conf.env)
conf.env.CPSYSCONFDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CPPATH}"),conf.env)
conf.env.CPLOGDIR = Utils.subst_vars(_join("${LOCALSTATEDIR}","log","${CPPATH}"),conf.env)
conf.env.CLIDIR = Utils.subst_vars(_join("${SYSCONFDIR}","${CLIPATH}"),conf.env)
conf.env.MSLOG = _join(conf.env.MSLOGDIR,"management-server.log")
conf.env.APISERVERLOG = _join(conf.env.MSLOGDIR,"api-server.log")