mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Merge branch 'master' of git.opennebula.org:one
This commit is contained in:
commit
e297233b69
@ -1,5 +1,5 @@
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* */
|
||||
/* 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 */
|
||||
|
@ -228,7 +228,7 @@ public:
|
||||
|
||||
static string version()
|
||||
{
|
||||
return "OpenNebula 2.3.0";
|
||||
return "OpenNebula 2.9.80";
|
||||
};
|
||||
|
||||
static string db_version()
|
||||
|
@ -912,7 +912,7 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \
|
||||
# ACCT files
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
ACCT_BIN_FILES="src/acct/acctd"
|
||||
ACCT_BIN_FILES="src/acct/oneacctd"
|
||||
|
||||
ACCT_LIB_FILES="src/acct/monitoring.rb \
|
||||
src/acct/accounting.rb \
|
||||
|
@ -54,6 +54,22 @@ group :ozones_server_sqlite do
|
||||
gem 'dm-sqlite-adapter'
|
||||
end
|
||||
|
||||
group :acct do
|
||||
gem 'sequel'
|
||||
gem 'sqlite3'
|
||||
gem 'mysql'
|
||||
end
|
||||
|
||||
group :acct_sqlite do
|
||||
gem 'sequel'
|
||||
gem 'sqlite3'
|
||||
end
|
||||
|
||||
group :acct_mysql do
|
||||
gem 'sequel'
|
||||
gem 'mysql'
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
PACKAGES=%w{optional sunstone quota cloud ozones_client ozones_server
|
||||
ozones_server_mysql ozones_server_sqlite}
|
||||
|
||||
DEFAULT=%w{optional sunstone quota cloud ozones_server}
|
||||
DEFAULT=%w{optional sunstone quota cloud ozones_server acct}
|
||||
|
||||
|
||||
class String
|
||||
@ -21,6 +21,29 @@ def try_library(name, error_message)
|
||||
end
|
||||
end
|
||||
|
||||
def install_warning(packages)
|
||||
puts "Use -h for help"
|
||||
puts
|
||||
puts "About to install the gems for these components:"
|
||||
puts "* "<<packages.join("\n* ")
|
||||
puts
|
||||
puts "Are you sure you want to continue? (YES/no)"
|
||||
yes=STDIN.readline
|
||||
|
||||
if yes.strip!="YES"
|
||||
puts "Installation aborted"
|
||||
exit(0)
|
||||
end
|
||||
end
|
||||
|
||||
def help
|
||||
puts "Specify the package dependencies from this list:"
|
||||
puts "* "<<PACKAGES.join("\n* ")
|
||||
puts
|
||||
puts "If no parameters are specified then this list will be used:"
|
||||
puts DEFAULT.join(' ')
|
||||
end
|
||||
|
||||
|
||||
try_library :rubygems, <<-EOT.unindent
|
||||
rubygems required to use this tool
|
||||
@ -46,6 +69,10 @@ try_library :bundler, <<-EOT.unindent
|
||||
[sudo] gem install bundler
|
||||
EOT
|
||||
|
||||
if ARGV.include?('-h')
|
||||
help
|
||||
exit(0)
|
||||
end
|
||||
|
||||
if ARGV.length>0
|
||||
packages=ARGV
|
||||
@ -58,8 +85,10 @@ no_packages<<'dummy'
|
||||
|
||||
without="--without #{no_packages.join(' ')}"
|
||||
|
||||
command_string = "bundle #{without}"
|
||||
command_string = "bundle install #{without}"
|
||||
|
||||
install_warning(packages)
|
||||
|
||||
puts command_string
|
||||
|
||||
#system command_string
|
||||
system command_string
|
||||
|
@ -15,7 +15,7 @@
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
# Database URI
|
||||
:DB: sqlite:///tmp/test_one_acct.db
|
||||
#:DB: sqlite:///var/one/oneacct.db
|
||||
|
||||
# Duration of each daemon loop in seconds
|
||||
:STEP: 300 # 5 minutes
|
||||
|
@ -60,7 +60,28 @@ start)
|
||||
|
||||
# acctd not running, safe to start
|
||||
$ACCTD_CMD &> $ACCTD_LOG &
|
||||
echo $! > $ACCTD_PID_FILE
|
||||
|
||||
LASTRC=$?
|
||||
LASTPID=$!
|
||||
|
||||
if [ $LASTRC -ne 0 ]; then
|
||||
echo "Error executing acctd."
|
||||
echo "Check $ACCTD_LOG for more information"
|
||||
exit 1
|
||||
else
|
||||
echo $LASTPID > $ACCTD_PID_FILE
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
ps $LASTPID > /dev/null 2>&1
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error executing acctd."
|
||||
echo "Check $ACCTD_LOG for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "acctd started"
|
||||
;;
|
||||
stop)
|
||||
# check if running
|
||||
@ -74,6 +95,8 @@ stop)
|
||||
ACCTD_PID=`cat $ACCTD_PID_FILE 2>/dev/null`
|
||||
kill $ACCTD_PID &> /dev/null
|
||||
rm -f $ACCTD_PID_FILE &> /dev/null
|
||||
|
||||
echo "acctd stop"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: acctd {start|stop}" >&2
|
@ -6,13 +6,20 @@ module WatchHelper
|
||||
|
||||
if !ONE_LOCATION
|
||||
ACCTD_CONF="/etc/one/acctd.conf"
|
||||
ACCT_DB="/var/one/oneacct.db"
|
||||
else
|
||||
ACCTD_CONF=ONE_LOCATION+"/etc/acctd.conf"
|
||||
ACCT_DB=ONE_LOCATION+"/var/oneacct.db"
|
||||
end
|
||||
|
||||
CONF = YAML.load_file(ACCTD_CONF)
|
||||
|
||||
DB = Sequel.connect(CONF[:DB])
|
||||
if CONF[:DB]
|
||||
DB = Sequel.connect(CONF[:DB])
|
||||
else
|
||||
DB = Sequel.connect("sqlite//#{ACCT_DB}")
|
||||
end
|
||||
|
||||
VM_DELTA = {
|
||||
:net_rx => {
|
||||
:type => Integer,
|
||||
|
@ -192,8 +192,7 @@ module CLIHelper
|
||||
size=@columns[field][:size]
|
||||
return "%#{minus}#{size}.#{size}s" % [ data.to_s ]
|
||||
else
|
||||
puts "Column not defined"
|
||||
exit -1
|
||||
exit -1, "Column not defined"
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -169,13 +169,7 @@ EOT
|
||||
if comm
|
||||
check_args!(comm_name, comm[:arity], comm[:args_format])
|
||||
|
||||
begin
|
||||
rc = comm[:proc].call
|
||||
rescue Exception =>e
|
||||
puts e.message
|
||||
exit -1
|
||||
end
|
||||
|
||||
rc = comm[:proc].call
|
||||
if rc.instance_of?(Array)
|
||||
puts rc[1]
|
||||
exit rc.first
|
||||
|
4
src/cli/etc/group.default
Normal file
4
src/cli/etc/group.default
Normal file
@ -0,0 +1,4 @@
|
||||
# This rule allows users in the new group to create common resources
|
||||
VM+NET+IMAGE+TEMPLATE/* CREATE
|
||||
# This rule allows users in the group to deploy VMs in any host in the cloud
|
||||
HOST/* USE
|
@ -21,7 +21,7 @@ include OpenNebula
|
||||
|
||||
module OpenNebulaHelper
|
||||
ONE_VERSION=<<-EOT
|
||||
OpenNebula 2.3.0
|
||||
OpenNebula 2.9.80
|
||||
Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -173,7 +173,7 @@ module CloudCLI
|
||||
|
||||
def version_text
|
||||
version=<<EOT
|
||||
OpenNebula 2.3.0
|
||||
OpenNebula 2.9.80
|
||||
Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* */
|
||||
/* 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 */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* */
|
||||
/* 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 */
|
||||
|
@ -1,7 +1,7 @@
|
||||
# SConstruct for src/group
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# 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 #
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* */
|
||||
/* 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 */
|
||||
|
@ -1,5 +1,5 @@
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org)
|
||||
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org)
|
||||
#
|
||||
# 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
|
||||
|
@ -83,7 +83,7 @@ do_documentation()
|
||||
-doctitle 'OpenNebula Cloud API Specification' \
|
||||
-header '<b>OpenNebula</b><br><font size="-1">Cloud API</font>' \
|
||||
-bottom 'Visit <a
|
||||
href="http://opennebula.org/">OpenNebula.org</a><br>Copyright 2002-2010 ©
|
||||
href="http://opennebula.org/">OpenNebula.org</a><br>Copyright 2002-2011 ©
|
||||
OpenNebula Project Leads (OpenNebula.org).'
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* */
|
||||
/* 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 */
|
||||
|
@ -1,7 +1,7 @@
|
||||
# SConstruct for src/pool
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# 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 #
|
||||
|
@ -67,7 +67,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div id="footer" class="ui-layout-south">
|
||||
Copyright 2002-2011 © OpenNebula Project Leads (<a href="http://opennebula.org" target="_blank">OpenNebula.org</a>). All Rights Reserved. OpenNebula 2.3.0
|
||||
Copyright 2002-2011 © OpenNebula Project Leads (<a href="http://opennebula.org" target="_blank">OpenNebula.org</a>). All Rights Reserved. OpenNebula 2.9.80
|
||||
</div>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user