mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-22 17:57:46 +03:00
bug #295: Hooks can be specified without absolute path. Adjusted share location for system-wide installations
This commit is contained in:
parent
13de50389f
commit
04874dbf7a
@ -236,6 +236,7 @@ private:
|
||||
etc_location = "/etc/one/";
|
||||
log_location = "/var/log/one/";
|
||||
var_location = "/var/lib/one/";
|
||||
hook_location= "/usr/share/one/hooks/";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -250,6 +251,7 @@ private:
|
||||
etc_location = nebula_location + "etc/";
|
||||
log_location = nebula_location + "var/";
|
||||
var_location = nebula_location + "var/";
|
||||
hook_location= nebula_location + "share/hooks/";
|
||||
}
|
||||
};
|
||||
|
||||
@ -345,6 +347,7 @@ private:
|
||||
string etc_location;
|
||||
string log_location;
|
||||
string var_location;
|
||||
string hook_location;
|
||||
string hostname;
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
* @param table the name of the table supporting the pool (to set the oid
|
||||
* counter). If null the OID counter is not updated.
|
||||
*/
|
||||
PoolSQL(SqlDB * _db, const char * table=0);
|
||||
PoolSQL(SqlDB * _db, const char * table);
|
||||
|
||||
virtual ~PoolSQL();
|
||||
|
||||
|
@ -32,7 +32,9 @@ class VirtualMachinePool : public PoolSQL
|
||||
{
|
||||
public:
|
||||
|
||||
VirtualMachinePool(SqlDB * db, vector<const Attribute *> hook_mads);
|
||||
VirtualMachinePool(SqlDB * db,
|
||||
vector<const Attribute *> hook_mads,
|
||||
const string& hook_location);
|
||||
|
||||
~VirtualMachinePool(){};
|
||||
|
||||
|
@ -99,7 +99,7 @@ if [ -z "$ROOT" ] ; then
|
||||
RUN_LOCATION="/var/run/one"
|
||||
LOCK_LOCATION="/var/lock/one"
|
||||
INCLUDE_LOCATION="/usr/include"
|
||||
SHARE_LOCATION="/usr/share/doc/opennebula"
|
||||
SHARE_LOCATION="/usr/share/one"
|
||||
|
||||
if [ "$CLIENT" = "no" ]; then
|
||||
MAKE_DIRS="$BIN_LOCATION $LIB_LOCATION $ETC_LOCATION $VAR_LOCATION \
|
||||
|
@ -224,7 +224,7 @@ void Nebula::start()
|
||||
|
||||
nebula_configuration->get("VM_HOOK", vm_hooks);
|
||||
|
||||
vmpool = new VirtualMachinePool(db, vm_hooks);
|
||||
vmpool = new VirtualMachinePool(db, vm_hooks,hook_location);
|
||||
hpool = new HostPool(db);
|
||||
|
||||
nebula_configuration->get("MAC_PREFIX", mac_prefix);
|
||||
|
@ -25,7 +25,8 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
VirtualMachinePool::VirtualMachinePool(SqlDB * db,
|
||||
vector<const Attribute *> hook_mads)
|
||||
vector<const Attribute *> hook_mads,
|
||||
const string& hook_location)
|
||||
: PoolSQL(db,VirtualMachine::table)
|
||||
{
|
||||
const VectorAttribute * vattr;
|
||||
@ -79,6 +80,11 @@ VirtualMachinePool::VirtualMachinePool(SqlDB * db,
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd[0] != '/')
|
||||
{
|
||||
cmd = hook_location + cmd;
|
||||
}
|
||||
|
||||
if ( on == "CREATE" )
|
||||
{
|
||||
VirtualMachineAllocateHook * hook;
|
||||
|
@ -87,7 +87,7 @@ class VirtualMachinePoolFriend : public VirtualMachinePool
|
||||
{
|
||||
public:
|
||||
VirtualMachinePoolFriend(SqlDB * db, vector<const Attribute *> hook_mads):
|
||||
VirtualMachinePool(db, hook_mads)
|
||||
VirtualMachinePool(db, hook_mads, "./")
|
||||
{};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user