diff --git a/agent/wscript_build b/agent/wscript_build
new file mode 100644
index 00000000000..583f4ac8963
--- /dev/null
+++ b/agent/wscript_build
@@ -0,0 +1,7 @@
+import Options
+
+bld.install_files("${AGENTLIBDIR}",
+ bld.path.ant_glob("storagepatch/**",src=True,bld=False,dir=False,flat=True),
+ cwd=bld.path,relative_trick=True)
+if not Options.options.PRESERVECONFIG:
+ bld.install_files_filtered("${AGENTSYSCONFDIR}","conf/*")
diff --git a/client/wscript_build b/client/wscript_build
new file mode 100644
index 00000000000..3c153257032
--- /dev/null
+++ b/client/wscript_build
@@ -0,0 +1,11 @@
+import Options
+
+start_path = bld.path.find_dir("WEB-INF")
+bld.install_files('${MSENVIRON}/webapps/client/WEB-INF',
+ start_path.ant_glob("**",src=True,bld=False,dir=False,flat=True),
+ cwd=start_path,relative_trick=True)
+
+if not Options.options.PRESERVECONFIG:
+ bld.install_files_filtered("${MSCONF}","tomcatconf/*")
+ bld.install_files("${MSCONF}",'tomcatconf/db.properties',chmod=0640)
+ bld.setownership("${MSCONF}/db.properties","root",bld.env.MSUSER)
diff --git a/console-proxy/wscript_build b/console-proxy/wscript_build
new file mode 100644
index 00000000000..d5221157768
--- /dev/null
+++ b/console-proxy/wscript_build
@@ -0,0 +1,10 @@
+import Options
+
+# binary unsubstitutable files:
+bld.install_files("${CPLIBDIR}",bld.path.ant_glob("images/**",src=True,bld=False,dir=False,flat=True),cwd=bld.path,relative_trick=True)
+
+# text substitutable files (substitute with tokens from the environment bld.env):
+bld.substitute('css/** js/** ui/** scripts/**',install_to="${CPLIBDIR}")
+
+# config files (do not replace them if preserve config option is true)
+if not Options.options.PRESERVECONFIG: bld.install_files_filtered("${CPSYSCONFDIR}","conf.dom0/*")
diff --git a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 069e31b26c9..f04aa4dd702 100644
--- a/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/core/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -1,5 +1,5 @@
/**
-: * Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
+ * Copyright (C) 2010 Cloud.com, Inc. All rights reserved.
*
* This software is licensed under the GNU General Public License v3 or later.
*
diff --git a/core/src/com/cloud/server/Criteria.java b/core/src/com/cloud/server/Criteria.java
index f2d7090341c..6d41b967be9 100644
--- a/core/src/com/cloud/server/Criteria.java
+++ b/core/src/com/cloud/server/Criteria.java
@@ -76,7 +76,8 @@ public class Criteria {
public static final String TARGET_IQN = "targetiqn";
public static final String SCOPE = "scope";
public static final String NETWORKGROUP = "networkGroup";
-
+ public static final String GROUP = "group";
+ public static final String EMPTY_GROUP = "emptyGroup";
public Criteria(String orderBy, Boolean ascending, Long offset, Long limit) {
this.offset = offset;
diff --git a/core/src/com/cloud/vm/dao/UserVmDaoImpl.java b/core/src/com/cloud/vm/dao/UserVmDaoImpl.java
index 6ab439486af..4e909b7b9f3 100755
--- a/core/src/com/cloud/vm/dao/UserVmDaoImpl.java
+++ b/core/src/com/cloud/vm/dao/UserVmDaoImpl.java
@@ -116,6 +116,8 @@ public class UserVmDaoImpl extends GenericDaoBase implements Use
DestroySearch.and("updateTime", DestroySearch.entity().getUpdateTime(), SearchCriteria.Op.LT);
DestroySearch.done();
+
+
_updateTimeAttr = _allAttributes.get("updateTime");
assert _updateTimeAttr != null : "Couldn't get this updateTime attribute";
}
diff --git a/daemonize/wscript_build b/daemonize/wscript_build
new file mode 100644
index 00000000000..ce5741a741a
--- /dev/null
+++ b/daemonize/wscript_build
@@ -0,0 +1,7 @@
+if bld.env.DISTRO not in ['Windows','Mac']:
+ # build / install declarations of the daemonization utility - except for Windows
+ bld(
+ name='daemonize',
+ features='cc cprogram',
+ source='daemonize.c',
+ target='cloud-daemonize')
\ No newline at end of file
diff --git a/deps/wscript_build b/deps/wscript_build
new file mode 100644
index 00000000000..11697814dd0
--- /dev/null
+++ b/deps/wscript_build
@@ -0,0 +1 @@
+bld.install_files('${JAVADIR}','*.jar')
diff --git a/patches/wscript_build b/patches/wscript_build
new file mode 100644
index 00000000000..4351d4e605d
--- /dev/null
+++ b/patches/wscript_build
@@ -0,0 +1,29 @@
+import os, Utils, glob, re
+
+bld.substitute("*/**",name="patchsubst")
+
+for virttech in Utils.to_list(bld.path.ant_glob("*",dir=True)):
+ if virttech in ["shared","wscript_build"]: continue
+ patchfiles = bld.path.ant_glob('%s/** shared/**'%virttech,src=True,bld=True,dir=False,flat=True)
+ tgen = bld(
+ features = 'tar',#Utils.tar_up,
+ source = patchfiles,
+ target = '%s-patch.tgz'%virttech,
+ name = '%s-patch_tgz'%virttech,
+ root = "patches/%s"%virttech,
+ rename = lambda x: re.sub(".subst$","",x),
+ after = 'patchsubst',
+ )
+ bld.process_after(tgen)
+ if virttech != "xenserver":
+ # xenserver uses the patch.tgz file later to make an ISO, so we do not need to install it
+ bld.install_as("${AGENTLIBDIR}/scripts/vm/hypervisor/%s/patch.tgz"%virttech, "%s-patch.tgz"%virttech)
+
+tgen = bld(
+ rule = 'cp ${SRC} ${TGT}',
+ source = 'xenserver-patch.tgz',
+ target = 'patch.tgz',
+ after = 'xenserver-patch_tgz',
+ name = 'patch_tgz'
+)
+bld.process_after(tgen)
diff --git a/python/wscript_build b/python/wscript_build
new file mode 100644
index 00000000000..4b78e04b404
--- /dev/null
+++ b/python/wscript_build
@@ -0,0 +1,3 @@
+if bld.env.DISTRO not in ['Windows','Mac']:
+ obj = bld(features = 'py',name='pythonmodules')
+ obj.find_sources_in_dirs('lib', exts=['.py'])
diff --git a/scripts/wscript_build b/scripts/wscript_build
new file mode 100644
index 00000000000..6730263e22f
--- /dev/null
+++ b/scripts/wscript_build
@@ -0,0 +1 @@
+bld.substitute('**',"${AGENTLIBDIR}/scripts",chmod=0755)
diff --git a/server/src/com/cloud/api/commands/ListVMsCmd.java b/server/src/com/cloud/api/commands/ListVMsCmd.java
index 0a61217a95c..5989d982630 100644
--- a/server/src/com/cloud/api/commands/ListVMsCmd.java
+++ b/server/src/com/cloud/api/commands/ListVMsCmd.java
@@ -53,6 +53,7 @@ public class ListVMsCmd extends BaseCmd {
s_properties.add(new Pair(BaseCmd.Properties.STATE, Boolean.FALSE));
s_properties.add(new Pair(BaseCmd.Properties.ZONE_ID, Boolean.FALSE));
s_properties.add(new Pair(BaseCmd.Properties.POD_ID, Boolean.FALSE));
+ s_properties.add(new Pair(BaseCmd.Properties.GROUP, Boolean.FALSE));
s_properties.add(new Pair(BaseCmd.Properties.HOST_ID, Boolean.FALSE));
s_properties.add(new Pair(BaseCmd.Properties.KEYWORD, Boolean.FALSE));
s_properties.add(new Pair(BaseCmd.Properties.ACCOUNT, Boolean.FALSE));
@@ -82,6 +83,7 @@ public class ListVMsCmd extends BaseCmd {
Long zoneId = (Long)params.get(BaseCmd.Properties.ZONE_ID.getName());
Long podId = (Long)params.get(BaseCmd.Properties.POD_ID.getName());
Long hostId = (Long)params.get(BaseCmd.Properties.HOST_ID.getName());
+ String group = (String)params.get(BaseCmd.Properties.GROUP.getName());
String keyword = (String)params.get(BaseCmd.Properties.KEYWORD.getName());
Integer page = (Integer)params.get(BaseCmd.Properties.PAGE.getName());
Integer pageSize = (Integer)params.get(BaseCmd.Properties.PAGESIZE.getName());
@@ -140,6 +142,14 @@ public class ListVMsCmd extends BaseCmd {
if(zoneId != null)
c.addCriteria(Criteria.DATACENTERID, zoneId);
+ if(group != null)
+ {
+ if(group.equals(""))
+ c.addCriteria(Criteria.EMPTY_GROUP, group);
+ else
+ c.addCriteria(Criteria.GROUP, group);
+ }
+
// ignore these search requests if it's not an admin
if (isAdmin == true) {
c.addCriteria(Criteria.DOMAINID, domainId);
diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java
index 3c65b3033e3..a1ce58b1599 100644
--- a/server/src/com/cloud/server/ManagementServerImpl.java
+++ b/server/src/com/cloud/server/ManagementServerImpl.java
@@ -4989,7 +4989,6 @@ public class ManagementServerImpl implements ManagementServer {
public List searchForUserVMs(Criteria c) {
Filter searchFilter = new Filter(UserVmVO.class, c.getOrderBy(), c.getAscending(), c.getOffset(), c.getLimit());
SearchBuilder sb = _userVmDao.createSearchBuilder();
-
// some criteria matter for generating the join condition
Object[] accountIds = (Object[]) c.getCriteria(Criteria.ACCOUNTID);
Object domainId = c.getCriteria(Criteria.DOMAINID);
@@ -5006,7 +5005,8 @@ public class ManagementServerImpl implements ManagementServer {
Object keyword = c.getCriteria(Criteria.KEYWORD);
Object isAdmin = c.getCriteria(Criteria.ISADMIN);
Object ipAddress = c.getCriteria(Criteria.IPADDRESS);
-
+ Object vmGroup = c.getCriteria(Criteria.GROUP);
+ Object emptyGroup = c.getCriteria(Criteria.EMPTY_GROUP);
sb.and("displayName", sb.entity().getDisplayName(), SearchCriteria.Op.LIKE);
sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ);
sb.and("accountIdEQ", sb.entity().getAccountId(), SearchCriteria.Op.EQ);
@@ -5020,7 +5020,8 @@ public class ManagementServerImpl implements ManagementServer {
sb.and("hostIdEQ", sb.entity().getHostId(), SearchCriteria.Op.EQ);
sb.and("hostIdIN", sb.entity().getHostId(), SearchCriteria.Op.IN);
sb.and("guestIP", sb.entity().getGuestIpAddress(), SearchCriteria.Op.EQ);
-
+ sb.and("groupEQ", sb.entity().getGroup(),SearchCriteria.Op.EQ);
+
if ((accountIds == null) && (domainId != null)) {
// if accountId isn't specified, we can do a domain match for the admin case
SearchBuilder domainSearch = _domainDao.createSearchBuilder();
@@ -5109,7 +5110,23 @@ public class ManagementServerImpl implements ManagementServer {
if (ipAddress != null) {
sc.setParameters("guestIP", ipAddress);
}
+
+ if(vmGroup!=null)
+ sc.setParameters("groupEQ", vmGroup);
+
+ if (emptyGroup!= null)
+ {
+ SearchBuilder emptyGroupSearch = _userVmDao.createSearchBuilder();
+ emptyGroupSearch.and("group", emptyGroupSearch.entity().getGroup(), SearchCriteria.Op.EQ);
+ emptyGroupSearch.or("null", emptyGroupSearch.entity().getGroup(), SearchCriteria.Op.NULL);
+ SearchCriteria sc1 = _userVmDao.createSearchCriteria();
+ sc1 = emptyGroupSearch.create();
+ sc1.setParameters("group", "");
+
+ sc.addAnd("group", SearchCriteria.Op.SC, sc1);
+ }
+
return _userVmDao.search(sc, searchFilter);
}
diff --git a/server/wscript_build b/server/wscript_build
new file mode 100644
index 00000000000..f6660680f77
--- /dev/null
+++ b/server/wscript_build
@@ -0,0 +1,4 @@
+import Options
+
+if not Options.options.PRESERVECONFIG:
+ bld.install_files_filtered("${SERVERSYSCONFDIR}","conf/*")
diff --git a/tools/waf/mkisofs.py b/tools/waf/mkisofs.py
new file mode 100644
index 00000000000..eb611577208
--- /dev/null
+++ b/tools/waf/mkisofs.py
@@ -0,0 +1,65 @@
+import Utils
+from TaskGen import feature, before
+import Task
+import os
+
+# fixme: this seems to hang waf with 100% CPU
+
+def detect(conf):
+ conf.find_program("mkisofs",mandatory=True,var='MKISOFS')
+
+def iso_up(task):
+ tgt = task.outputs[0].bldpath(task.env)
+ if os.path.exists(tgt): os.unlink(tgt)
+ inps = []
+ for inp in task.inputs:
+ if inp.id&3==Node.BUILD:
+ src = inp.bldpath(task.env)
+ srcname = src
+ srcname = "/".join(srcname.split("/")[1:]) # chop off default/
+ else:
+ src = inp.srcpath(task.env)
+ srcname = src
+ srcname = "/".join(srcname.split("/")[1:]) # chop off ../
+ inps.append(src)
+ ret = Utils.exec_command(
+ [
+ task.generator.env.MKISOFS,
+ "-quiet",
+ "-r",
+ "-o",tgt,
+ ] + inps, shell=False)
+ if ret != 0: return ret
+ if task.chmod: os.chmod(tgt,task.chmod)
+
+def apply_iso(self):
+ Utils.def_attrs(self,fun=iso_up)
+ self.default_install_path=0
+ lst=self.to_list(self.source)
+ self.meths.remove('apply_core')
+ self.dict=getattr(self,'dict',{})
+ out = self.path.find_or_declare(self.target)
+ ins = []
+ for x in Utils.to_list(self.source):
+ node = self.path.find_resource(x)
+ if not node:raise Utils.WafError('cannot find input file %s for processing'%x)
+ ins.append(node)
+ if self.dict and not self.env['DICT_HASH']:
+ self.env=self.env.copy()
+ keys=list(self.dict.keys())
+ keys.sort()
+ lst=[self.dict[x]for x in keys]
+ self.env['DICT_HASH']=str(Utils.h_list(lst))
+ tsk=self.create_task('iso',ins,out)
+ tsk.fun=self.fun
+ tsk.dict=self.dict
+ tsk.dep_vars=['DICT_HASH']
+ tsk.install_path=self.install_path
+ tsk.chmod=self.chmod
+ if not tsk.env:
+ tsk.debug()
+ raise Utils.WafError('task without an environment')
+
+Task.task_type_from_func('iso',func=iso_up)
+feature('iso')(apply_iso)
+before('apply_core')(apply_iso)
\ No newline at end of file
diff --git a/tools/waf/tar.py b/tools/waf/tar.py
new file mode 100644
index 00000000000..c0293337b90
--- /dev/null
+++ b/tools/waf/tar.py
@@ -0,0 +1,74 @@
+import Utils
+import tarfile
+from TaskGen import feature, before
+import Task
+import os
+
+# this is a clever little thing
+# given a list of nodes, build or source
+# construct a tar file containing them
+# rooted in the parameter root =, specified in the task generator
+# and renaming the names of the files according to a rename(x) function passed to the task generator as well
+# if a build node's result of rename() has the same name as a source node, the build node will take precedence
+# for as long as the build node appears later than the source node (this is an implementation detail of waf we are relying on)
+def tar_up(task):
+ tgt = task.outputs[0].bldpath(task.env)
+ if os.path.exists(tgt): os.unlink(tgt)
+ if tgt.lower().endswith(".bz2"): z = tarfile.open(tgt,"w:bz2")
+ elif tgt.lower().endswith(".gz"): z = tarfile.open(tgt,"w:gz")
+ elif tgt.lower().endswith(".tgz"): z = tarfile.open(tgt,"w:gz")
+ else: z = tarfile.open(tgt,"w")
+ fileset = {}
+ for inp in task.inputs:
+ src = inp.srcpath(task.env)
+ if src.startswith(".."):
+ srcname = Utils.relpath(src,os.path.join("..",".")) # file in source dir
+ else:
+ srcname = Utils.relpath(src,os.path.join(task.env.variant(),".")) # file in artifacts dir
+ if task.generator.rename: srcname = task.generator.rename(srcname)
+ for dummy in task.generator.root.split("/"):
+ splittedname = srcname.split("/")
+ srcname = "/".join(splittedname[1:])
+ fileset[srcname] = src
+ for srcname,src in fileset.items():
+ ti = tarfile.TarInfo(srcname)
+ ti.mode = 0755
+ ti.size = os.path.getsize(src)
+ f = file(src)
+ z.addfile(ti,fileobj=f)
+ f.close()
+ z.close()
+ if task.chmod: os.chmod(tgt,task.chmod)
+ return 0
+
+def apply_tar(self):
+ Utils.def_attrs(self,fun=tar_up)
+ self.default_install_path=0
+ lst=self.to_list(self.source)
+ self.meths.remove('apply_core')
+ self.dict=getattr(self,'dict',{})
+ out = self.path.find_or_declare(self.target)
+ ins = []
+ for x in Utils.to_list(self.source):
+ node = self.path.find_resource(x)
+ if not node:raise Utils.WafError('cannot find input file %s for processing'%x)
+ ins.append(node)
+ if self.dict and not self.env['DICT_HASH']:
+ self.env=self.env.copy()
+ keys=list(self.dict.keys())
+ keys.sort()
+ lst=[self.dict[x]for x in keys]
+ self.env['DICT_HASH']=str(Utils.h_list(lst))
+ tsk=self.create_task('tar',ins,out)
+ tsk.fun=self.fun
+ tsk.dict=self.dict
+ tsk.dep_vars=['DICT_HASH']
+ tsk.install_path=self.install_path
+ tsk.chmod=self.chmod
+ if not tsk.env:
+ tsk.debug()
+ raise Utils.WafError('task without an environment')
+
+Task.task_type_from_func('tar',func=tar_up)
+feature('tar')(apply_tar)
+before('apply_core')(apply_tar)
\ No newline at end of file
diff --git a/ui/new/index.jsp b/ui/new/index.jsp
index 35b3e71c526..04f8230d2ae 100644
--- a/ui/new/index.jsp
+++ b/ui/new/index.jsp
@@ -608,7 +608,7 @@
- IP Address:
+ IP Address:
-
+
+