diff --git a/flow/Rakefile b/flow/Rakefile index a4c9a52881..633bffa619 100644 --- a/flow/Rakefile +++ b/flow/Rakefile @@ -1,4 +1,19 @@ #!/usr/bin/env rake +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'rspec/core/rake_task' RSpec::Core::RakeTask.new(:spec) do |t| diff --git a/flow/bin/appflow-server b/flow/bin/appflow-server index 87054a8272..dce651e03b 100755 --- a/flow/bin/appflow-server +++ b/flow/bin/appflow-server @@ -1,31 +1,30 @@ #! /bin/sh # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # if [ -z "$ONE_LOCATION" ]; then FLOW_PID=/var/run/one/appflow-server.pid - FLOW_SERVER=/usr/lib/one/ruby/apptools/flow/controllers/appflow-server.rb + FLOW_SERVER=/usr/lib/one/ruby/oneapps/flow/controllers/appflow-server.rb FLOW_LOCK_FILE=/var/lock/one/.appflow.lock FLOW_LOG=/var/log/one/appflow-server.log FLOW_LOG_ERROR=/var/log/one/appflow-server.error FLOW_ETC=/etc/one/appflow-server.conf else FLOW_PID=$ONE_LOCATION/var/appflow-server.pid - FLOW_SERVER=$ONE_LOCATION/lib/ruby/apptools/flow/controllers/appflow-server.rb + FLOW_SERVER=$ONE_LOCATION/lib/ruby/oneapps/flow/controllers/appflow-server.rb FLOW_LOCK_FILE=$ONE_LOCATION/var/.appflow.lock FLOW_LOG=$ONE_LOCATION/var/appflow-server.log FLOW_LOG_ERROR=$ONE_LOCATION/var/appflow-server.error diff --git a/flow/client/bin/appflow b/flow/client/bin/appflow index f7729ced20..f205ea1bf8 100755 --- a/flow/client/bin/appflow +++ b/flow/client/bin/appflow @@ -1,5 +1,20 @@ #!/usr/bin/env ruby +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION @@ -11,7 +26,7 @@ end $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+'/cli' -require 'apptools/flow/appflow_client' +require 'oneapps/flow/appflow_client' require 'command_parser' require 'cli_helper' diff --git a/flow/client/bin/appflow-template b/flow/client/bin/appflow-template index 5c3630faab..416b9151ef 100755 --- a/flow/client/bin/appflow-template +++ b/flow/client/bin/appflow-template @@ -1,5 +1,20 @@ #!/usr/bin/env ruby +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION @@ -11,7 +26,7 @@ end $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+'/cli' -require 'apptools/flow/appflow_client' +require 'oneapps/flow/appflow_client' require 'command_parser' require 'cli_helper' diff --git a/flow/client/lib/appflow_client.rb b/flow/client/lib/appflow_client.rb index 5343190b0d..90c18f4e53 100644 --- a/flow/client/lib/appflow_client.rb +++ b/flow/client/lib/appflow_client.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'uri' require 'cloud/CloudClient' diff --git a/flow/config.ru b/flow/config.ru index ead48ef4e8..84e4ce2f37 100644 --- a/flow/config.ru +++ b/flow/config.ru @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + $: << '.' require 'controllers/appflow-server' diff --git a/flow/config/appflow-server.conf b/flow/config/appflow-server.conf index de021cbbac..a47f0c4587 100644 --- a/flow/config/appflow-server.conf +++ b/flow/config/appflow-server.conf @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + ################################################################################ # Server Configuration ################################################################################ diff --git a/flow/controllers/appflow-server.rb b/flow/controllers/appflow-server.rb index 48d8c3b545..2bbcfeaab4 100644 --- a/flow/controllers/appflow-server.rb +++ b/flow/controllers/appflow-server.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'rubygems' require 'sinatra' require 'yaml' @@ -23,7 +38,7 @@ CONFIGURATION_FILE = ETC_LOCATION + "/appflow-server.conf" $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+'/cloud' -$: << RUBY_LIB_LOCATION+'/apptools/flow' +$: << RUBY_LIB_LOCATION+'/oneapps/flow' require 'CloudAuth' require 'CloudServer' diff --git a/flow/lcm/LifeCycleManager.rb b/flow/lcm/LifeCycleManager.rb index 9dd7ad0312..874359dc67 100644 --- a/flow/lcm/LifeCycleManager.rb +++ b/flow/lcm/LifeCycleManager.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # diff --git a/flow/lcm/strategy.rb b/flow/lcm/strategy.rb index 718f90fb39..3af3b29390 100644 --- a/flow/lcm/strategy.rb +++ b/flow/lcm/strategy.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # diff --git a/flow/lcm/strategy/straight.rb b/flow/lcm/strategy/straight.rb index 337175b17f..4d631f431c 100644 --- a/flow/lcm/strategy/straight.rb +++ b/flow/lcm/strategy/straight.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + module Straight # Using this strategy the service is deployed based on a directed # acyclic graph where each node defines its parents. diff --git a/flow/lib/log.rb b/flow/lib/log.rb index 9d6f4b70dc..d340d0d8bf 100644 --- a/flow/lib/log.rb +++ b/flow/lib/log.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # diff --git a/flow/lib/validator.rb b/flow/lib/validator.rb index 15f775b0d0..9590f1a4a0 100644 --- a/flow/lib/validator.rb +++ b/flow/lib/validator.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'uri' class Hash diff --git a/flow/models.rb b/flow/models.rb index a0b3fd40ed..6a8f30bcca 100644 --- a/flow/models.rb +++ b/flow/models.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'OpenNebula' include OpenNebula diff --git a/flow/models/Role.rb b/flow/models/Role.rb index 5f6d0fa8f3..dd1bc7c6f7 100644 --- a/flow/models/Role.rb +++ b/flow/models/Role.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # diff --git a/flow/models/Service.rb b/flow/models/Service.rb index da0734fbc7..a583b19773 100644 --- a/flow/models/Service.rb +++ b/flow/models/Service.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # diff --git a/flow/models/ServicePool.rb b/flow/models/ServicePool.rb index 73331679c5..5ac05098c3 100644 --- a/flow/models/ServicePool.rb +++ b/flow/models/ServicePool.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # @@ -67,7 +66,7 @@ module OpenNebula if entry.nil? entry = [Mutex.new, 0] - + @@mutex_hash[service_id] = entry end diff --git a/flow/models/ServiceTemplate.rb b/flow/models/ServiceTemplate.rb index f0a1aee577..1ad4029b1e 100644 --- a/flow/models/ServiceTemplate.rb +++ b/flow/models/ServiceTemplate.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # diff --git a/flow/models/ServiceTemplatePool.rb b/flow/models/ServiceTemplatePool.rb index 6dd81ad221..31c675a909 100644 --- a/flow/models/ServiceTemplatePool.rb +++ b/flow/models/ServiceTemplatePool.rb @@ -1,16 +1,15 @@ # -------------------------------------------------------------------------- # -# Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) # +# Copyright 2010-2012, C12G Labs S.L. # # # -# 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 # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # # # -# 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 # +# Unless 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. # #--------------------------------------------------------------------------- # diff --git a/flow/sunstone/etc/sunstone-appflow.conf b/flow/sunstone/etc/sunstone-appflow.conf index 188a091b56..2b66ee924b 100644 --- a/flow/sunstone/etc/sunstone-appflow.conf +++ b/flow/sunstone/etc/sunstone-appflow.conf @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + ################################################################################ # Appflow ################################################################################ diff --git a/flow/sunstone/routes/appflow.rb b/flow/sunstone/routes/appflow.rb index 916f1eaae9..3a1932052f 100644 --- a/flow/sunstone/routes/appflow.rb +++ b/flow/sunstone/routes/appflow.rb @@ -1,6 +1,21 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + APPFLOW_CONF_FILE = ETC_LOCATION + "/sunstone-appflow.conf" -$: << RUBY_LIB_LOCATION+"/apptools/flow" +$: << RUBY_LIB_LOCATION+"/oneapps/flow" require 'appflow_client' diff --git a/gen_package.sh b/gen_package.sh index b81f8b17b7..7ee273a173 100755 --- a/gen_package.sh +++ b/gen_package.sh @@ -19,10 +19,10 @@ VERSION=${VERSION:-3.6.0} MAINTAINER=${MAINTAINER:-C12G Labs } LICENSE=${LICENSE:-Apache} -PACKAGE_NAME=${PACKAGE_NAME:-apptools} +PACKAGE_NAME=${PACKAGE_NAME:-oneapps} VENDOR=${VENDOR:-C12G Labs} DESC=" -AppTools description +OpenNebula Apps description " DESCRIPTION=${DESCRIPTION:-$DESC} PACKAGE_TYPE=${PACKAGE_TYPE:-deb} @@ -32,16 +32,20 @@ SCRIPTS_DIR=$PWD NAME="${PACKAGE_NAME}_${VERSION}.${PACKAGE_TYPE}" rm $NAME -DIRS="apptools env flow market" +DIRS="oneapps stage flow market" export DESTDIR=$PWD/tmp +if [ "$(id -u)" = "0" ]; then + OWNER_FLAGS='-u oneadmin -g oneadmin' +fi + rm -rf $DESTDIR mkdir $DESTDIR for TOOL in $DIRS; do ( cd $TOOL - ./install.sh + ./install.sh $OWNER_FLAGS ) done diff --git a/install_lib.sh b/install_lib.sh index 7b1946dd0b..ce62f12be7 100644 --- a/install_lib.sh +++ b/install_lib.sh @@ -51,17 +51,17 @@ while true ; do done if [ -z "$ROOT" ]; then - LIB_LOCATION="/usr/lib/one/ruby/apptools" + LIB_LOCATION="/usr/lib/one/ruby/oneapps" BIN_LOCATION="/usr/bin" - PACKAGES_LOCATION="/usr/share/one/apptools" - SHARE_LOCATION="/usr/share/one/apptools" + PACKAGES_LOCATION="/usr/share/one/oneapps" + SHARE_LOCATION="/usr/share/one/oneapps" ETC_LOCATION="/etc/one" SUNSTONE_LOCATION="/usr/lib/one/sunstone" else - LIB_LOCATION="$ROOT/lib/ruby/apptools" + LIB_LOCATION="$ROOT/lib/ruby/oneapps" BIN_LOCATION="$ROOT/bin" - PACKAGES_LOCATION="$ROOT/share/apptools" - SHARE_LOCATION="$ROOT/share/apptools" + PACKAGES_LOCATION="$ROOT/share/oneapps" + SHARE_LOCATION="$ROOT/share/oneapps" ETC_LOCATION="$ROOT/etc" SUNSTONE_LOCATION="$ROOT/lib/sunstone" fi diff --git a/market/Gemfile b/market/Gemfile index dead67e2f3..92a322c9ad 100644 --- a/market/Gemfile +++ b/market/Gemfile @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + source "http://rubygems.org" gem 'json' diff --git a/market/Rakefile b/market/Rakefile index 0259d0e06f..0a27807db9 100644 --- a/market/Rakefile +++ b/market/Rakefile @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + $: << './' require 'models' diff --git a/market/bin/appmarket-server b/market/bin/appmarket-server index feb562cecb..85bb43841d 100755 --- a/market/bin/appmarket-server +++ b/market/bin/appmarket-server @@ -18,14 +18,14 @@ if [ -z "$ONE_LOCATION" ]; then MARKET_PID=/var/run/one/appmarket-server.pid - MARKET_SERVER=/usr/lib/one/ruby/apptools/market/controllers/appmarket-server.rb + MARKET_SERVER=/usr/lib/one/ruby/oneapps/market/controllers/appmarket-server.rb MARKET_LOCK_FILE=/var/lock/one/.appmarket.lock MARKET_LOG=/var/log/one/appmarket-server.log MARKET_LOG_ERROR=/var/log/one/appmarket-server.error MARKET_ETC=/etc/one/appmarket-server.conf else MARKET_PID=$ONE_LOCATION/var/appmarket-server.pid - MARKET_SERVER=$ONE_LOCATION/lib/ruby/apptools/market/controllers/appmarket-server.rb + MARKET_SERVER=$ONE_LOCATION/lib/ruby/oneapps/market/controllers/appmarket-server.rb MARKET_LOCK_FILE=$ONE_LOCATION/var/.appmarket.lock MARKET_LOG=$ONE_LOCATION/var/appmarket-server.log MARKET_LOG_ERROR=$ONE_LOCATION/var/appmarket-server.error diff --git a/market/client/bin/appmarket b/market/client/bin/appmarket index 79a3340b79..6617772b7f 100755 --- a/market/client/bin/appmarket +++ b/market/client/bin/appmarket @@ -1,5 +1,20 @@ #!/usr/bin/env ruby +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION @@ -8,7 +23,7 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end -$: << RUBY_LIB_LOCATION+"/apptools/market" +$: << RUBY_LIB_LOCATION+"/oneapps/market" $: << RUBY_LIB_LOCATION+"/cloud" $: << RUBY_LIB_LOCATION+"/cli" diff --git a/market/client/bin/appmarket-user b/market/client/bin/appmarket-user index 828fd4c343..3b1f62b1ea 100755 --- a/market/client/bin/appmarket-user +++ b/market/client/bin/appmarket-user @@ -1,5 +1,20 @@ #!/usr/bin/env ruby +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + ONE_LOCATION=ENV["ONE_LOCATION"] if !ONE_LOCATION @@ -8,7 +23,7 @@ else RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" end -$: << RUBY_LIB_LOCATION+"/apptools/market" +$: << RUBY_LIB_LOCATION+"/oneapps/market" $: << RUBY_LIB_LOCATION+"/cloud" $: << RUBY_LIB_LOCATION+"/cli" diff --git a/market/client/lib/appmarket_client.rb b/market/client/lib/appmarket_client.rb index 8aaac18d65..160bc9165f 100644 --- a/market/client/lib/appmarket_client.rb +++ b/market/client/lib/appmarket_client.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'uri' require 'CloudClient' diff --git a/market/config.ru b/market/config.ru index b4e73551d6..5cccbbd51f 100644 --- a/market/config.ru +++ b/market/config.ru @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + $: << '.' require 'controllers/appmarket-server' diff --git a/market/config/appmarket-server.conf b/market/config/appmarket-server.conf index a8dde2533d..cd9d300310 100644 --- a/market/config/appmarket-server.conf +++ b/market/config/appmarket-server.conf @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + # Host and port where AppMarket server will run :host: 127.0.0.1 :port: 6242 @@ -19,11 +34,11 @@ user: # Parameters that will be used to configure the delivery method of the # mail service. More information: http://rubygems.org/gems/mail -mail: - :address: mail.default.com - :port: 587 - :domain: default.com - :user_name: default@default.com - :password: password - :authentication: plain - :enable_starttls_auto: false \ No newline at end of file +#mail: +# :address: mail.default.com +# :port: 587 +# :domain: default.com +# :user_name: default@default.com +# :password: password +# :authentication: plain +# :enable_starttls_auto: false diff --git a/market/config/init.rb b/market/config/init.rb index eed240be34..fd46e3227f 100644 --- a/market/config/init.rb +++ b/market/config/init.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'rubygems' require 'mongo' require 'yaml' diff --git a/market/controllers/appmarket-server.rb b/market/controllers/appmarket-server.rb index 72e66fb123..f0c25f6325 100644 --- a/market/controllers/appmarket-server.rb +++ b/market/controllers/appmarket-server.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'rubygems' require 'sinatra' require 'haml' @@ -22,7 +37,7 @@ CONFIGURATION_FILE = ETC_LOCATION + "/appmarket-server.conf" $: << RUBY_LIB_LOCATION $: << RUBY_LIB_LOCATION+'/cloud' -$: << RUBY_LIB_LOCATION+'/apptools/market' +$: << RUBY_LIB_LOCATION+'/oneapps/market' require 'models' require 'session' diff --git a/market/lib/mailer.rb b/market/lib/mailer.rb index f536405a7e..25fa2d018e 100644 --- a/market/lib/mailer.rb +++ b/market/lib/mailer.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'mail' require 'erb' diff --git a/market/lib/parser.rb b/market/lib/parser.rb index 21d12e2932..1cb08bf8d7 100644 --- a/market/lib/parser.rb +++ b/market/lib/parser.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'json' module Parser diff --git a/market/lib/session.rb b/market/lib/session.rb index c0453d3849..524cb5cf41 100644 --- a/market/lib/session.rb +++ b/market/lib/session.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'digest/sha1' class Session diff --git a/market/lib/validator.rb b/market/lib/validator.rb index 88cd48a916..9590f1a4a0 100644 --- a/market/lib/validator.rb +++ b/market/lib/validator.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'uri' class Hash @@ -243,12 +258,10 @@ class Validator # # def validate_integer(body, schema_array, schema_key) - if body.is_a?(Integer) - body - else - raise ParseException, "KEY: '#{schema_key}' must be an Integer;"\ - " SCHEMA: #{schema_array}" - end + Integer(body) + rescue ArgumentError + raise ParseException, "KEY: '#{schema_key}' must be an Integer;"\ + " SCHEMA: #{schema_array}" end # Validate an null type diff --git a/market/models.rb b/market/models.rb index 48b6da165a..c02fe76ec1 100644 --- a/market/models.rb +++ b/market/models.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'init' require 'validator' diff --git a/market/models/appliance.rb b/market/models/appliance.rb index 25cefcef2d..8ddfede51d 100644 --- a/market/models/appliance.rb +++ b/market/models/appliance.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'uri' require 'net/http' diff --git a/market/models/user.rb b/market/models/user.rb index d31f795d11..47ed8aec38 100644 --- a/market/models/user.rb +++ b/market/models/user.rb @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + require 'bcrypt' class User diff --git a/market/sunstone/etc/sunstone-appmarket.conf b/market/sunstone/etc/sunstone-appmarket.conf index 6a5a3b1086..a0944b0b9c 100644 --- a/market/sunstone/etc/sunstone-appmarket.conf +++ b/market/sunstone/etc/sunstone-appmarket.conf @@ -1,3 +1,18 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + ################################################################################ # AppMarket ################################################################################ diff --git a/market/sunstone/routes/appmarket.rb b/market/sunstone/routes/appmarket.rb index e725f4071c..e6e1c86df7 100644 --- a/market/sunstone/routes/appmarket.rb +++ b/market/sunstone/routes/appmarket.rb @@ -1,6 +1,21 @@ +# -------------------------------------------------------------------------- # +# Copyright 2010-2012, C12G Labs S.L. # +# # +# Licensed under the C12G Commercial Open-source License (the # +# "License"); you may not use this file except in compliance # +# with the License. You may obtain a copy of the License as part # +# of the software distribution. # +# # +# Unless 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. # +#--------------------------------------------------------------------------- # + APPMARKET_CONF_FILE = ETC_LOCATION + "/sunstone-appmarket.conf" -$: << RUBY_LIB_LOCATION+"/apptools/market" +$: << RUBY_LIB_LOCATION+"/oneapps/market" require 'appmarket_client' diff --git a/market/views/app_form.haml b/market/views/app_form.haml index 9b61f16c38..9751814a95 100644 --- a/market/views/app_form.haml +++ b/market/views/app_form.haml @@ -1,3 +1,18 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + %fieldset .control-group %label.control-label{'for' => 'name_form'} Name diff --git a/market/views/appliance_index.haml b/market/views/appliance_index.haml index c231f7b6ce..b2f14b46dc 100644 --- a/market/views/appliance_index.haml +++ b/market/views/appliance_index.haml @@ -1,10 +1,25 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + .navbar.navbar-static .navbar-inner .container %ul.nav.nav-pills %li - %form{class: "navbar-search pull-left", action: ""} - %input{id: "search", type: "text" , placeholder: "Search", onKeyPress: "return disableEnterKey(event)"} + %form{'class' => "navbar-search pull-left", 'action' => ""} + %input{'id' => "search", 'type' => "text" , 'placeholder' => "Search", 'onKeyPress' => "return disableEnterKey(event)"} %li %a{'href' => "#asearch_form", 'data-toggle' => "collapse"} @@ -54,7 +69,7 @@ %select#format.span2 - %table{class: "table table-striped table-no-head", id: "apps"} + %table{'class' => "table table-striped table-no-head", 'id' => "apps"} %thead %tr %th Appliances diff --git a/market/views/appliance_show.haml b/market/views/appliance_show.haml index aa948da6e3..5e4103a8ca 100644 --- a/market/views/appliance_show.haml +++ b/market/views/appliance_show.haml @@ -1,7 +1,22 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + .navbar.navbar-static .navbar-inner .container - %a.brand{href:"/"} Appliances + %a.brand{'href' => "/"} Appliances = haml :nav_login .container-fluid diff --git a/market/views/custom/banner.haml b/market/views/custom/banner.haml index 064bf70b21..dea91e5f71 100644 --- a/market/views/custom/banner.haml +++ b/market/views/custom/banner.haml @@ -1,3 +1,18 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + .row-fluid .span4 :plain diff --git a/market/views/custom/footer.haml b/market/views/custom/footer.haml index 3f629946c1..1e16ade778 100644 --- a/market/views/custom/footer.haml +++ b/market/views/custom/footer.haml @@ -1,3 +1,18 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + %p © 2012 C12G Labs S.L. All Rights Reserved. %a{'href' => "http://www.c12g.com/legal-notice"} Legal Notice. diff --git a/market/views/custom/logos.haml b/market/views/custom/logos.haml index 1ad6a7e484..5f4b8b55e3 100644 --- a/market/views/custom/logos.haml +++ b/market/views/custom/logos.haml @@ -1,3 +1,18 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + %a.span4{'href' => "http://www.opennebula.org/"} %img{'src' => "/img/opennebula_gray.png"} %a.pull-right{'href' => "http://www.c12g.com/"} diff --git a/market/views/custom/terms_of_use.haml b/market/views/custom/terms_of_use.haml index 885c25fe39..5a0d556322 100644 --- a/market/views/custom/terms_of_use.haml +++ b/market/views/custom/terms_of_use.haml @@ -1,2 +1,17 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + Accept %a{'href' => 'http://www.c12g.com//marketplace-terms-of-use', 'target' => 'blank'} Terms of Use \ No newline at end of file diff --git a/market/views/custom/tittle.haml b/market/views/custom/tittle.haml index ca4380cf1d..1671958df0 100644 --- a/market/views/custom/tittle.haml +++ b/market/views/custom/tittle.haml @@ -1,2 +1,17 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + %i.icon-shopping-cart.icon-white OpenNebula AppMarket \ No newline at end of file diff --git a/market/views/layout.haml b/market/views/layout.haml index c612316c13..27f241b42f 100644 --- a/market/views/layout.haml +++ b/market/views/layout.haml @@ -1,3 +1,18 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + !!! %html{:lang => "en"} %head diff --git a/market/views/nav_login.haml b/market/views/nav_login.haml index 3ac054fb21..f4d94a19a5 100644 --- a/market/views/nav_login.haml +++ b/market/views/nav_login.haml @@ -1,3 +1,18 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + %ul.nav.pull-right.nav-pills %li.divider-vertical - if @session.anonymous? diff --git a/market/views/user_form.haml b/market/views/user_form.haml index 3f7ae1cb3d..e99f0edd7a 100644 --- a/market/views/user_form.haml +++ b/market/views/user_form.haml @@ -1,3 +1,18 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + %fieldset .control-group %label.control-label{'for' => 'organization_form'} Organization diff --git a/market/views/user_index.haml b/market/views/user_index.haml index 8b9044fa65..068c883d18 100644 --- a/market/views/user_index.haml +++ b/market/views/user_index.haml @@ -1,10 +1,25 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + .navbar.navbar-static .navbar-inner .container - %a.brand{href:"/"} Appliances + %a.brand{href => "/"} Appliances = haml :nav_login -%table{class: "table table-striped", id: "users"} +%table{'class' => "table table-striped", 'id' => "users"} %thead %tr %th username diff --git a/market/views/user_show.haml b/market/views/user_show.haml index c394286c24..6176974935 100644 --- a/market/views/user_show.haml +++ b/market/views/user_show.haml @@ -1,7 +1,22 @@ +//--------------------------------------------------------------------------// +// Copyright 2010-2012, C12G Labs S.L. // +// // +// Licensed under the C12G Commercial Open-source License (the // +// "License"); you may not use this file except in compliance // +// with the License. You may obtain a copy of the License as part // +// of the software distribution. // +// // +// Unless 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. // +//--------------------------------------------------------------------------// + .navbar.navbar-static .navbar-inner .container - %a.brand{href:"/user"} Users + %a.brand{href => "/user"} Users = haml :nav_login .container-fluid diff --git a/apptools/install.sh b/oneapps/install.sh similarity index 100% rename from apptools/install.sh rename to oneapps/install.sh diff --git a/apptools/share/sunstone/public/js/opennebula.js b/oneapps/share/sunstone/public/js/opennebula.js similarity index 96% rename from apptools/share/sunstone/public/js/opennebula.js rename to oneapps/share/sunstone/public/js/opennebula.js index e5feba7291..571364a855 100644 --- a/apptools/share/sunstone/public/js/opennebula.js +++ b/oneapps/share/sunstone/public/js/opennebula.js @@ -44,12 +44,11 @@ var OpenNebula = { "Helper": { "resource_state": function(type, value) { - var state; switch(type) { case "HOST": case "host": - state = tr(["INIT", + return tr(["INIT", "MONITORING_MONITORED", "MONITORED", "ERROR", @@ -58,7 +57,7 @@ var OpenNebula = { break; case "HOST_SIMPLE": case "host_simple": - state = tr(["INIT", + return tr(["INIT", "UPDATE", "ON", "ERROR", @@ -67,19 +66,18 @@ var OpenNebula = { break; case "VM": case "vm": - state = tr(["INIT", + return tr(["INIT", "PENDING", "HOLD", "ACTIVE", "STOPPED", "SUSPENDED", "DONE", - "FAILED", - "POWEROFF"][value]); + "FAILED"][value]); break; case "VM_LCM": case "vm_lcm": - state = tr(["LCM_INIT", + return tr(["LCM_INIT", "PROLOG", "BOOT", "RUNNING", @@ -96,12 +94,11 @@ var OpenNebula = { "FAILURE", "CLEANUP", "UNKNOWN", - "HOTPLUG", - "SHUTDOWN_POWEROFF"][value]); + "HOTPLUG"][value]); break; case "IMAGE": case "image": - state = tr(["INIT", + return tr(["INIT", "READY", "USED", "DISABLED", @@ -113,17 +110,15 @@ var OpenNebula = { break; case "VM_MIGRATE_REASON": case "vm_migrate_reason": - state = tr(["NONE", + return tr(["NONE", "ERROR", "STOP_RESUME", "USER", "CANCEL"][value]); break; default: - return value; + return; } - if (!state) state = value - return state; }, "image_type": function(value) @@ -361,6 +356,7 @@ var OpenNebula = { var data = params.data; var method = "monitor"; + var action = OpenNebula.Helper.action(method); var request = OpenNebula.Helper.request(resource,method, data); var url = path ? path : resource.toLowerCase(); @@ -401,16 +397,9 @@ var OpenNebula = { type: "POST", data: {remember: remember}, beforeSend : function(req) { - var token = username + ':' + password; - var authString = 'Basic '; - if (typeof(btoa) === 'function') - authString += btoa(token) - else { - token = CryptoJS.enc.Utf8.parse(token); - authString += CryptoJS.enc.Base64.stringify(token) - } - - req.setRequestHeader( "Authorization", authString); + req.setRequestHeader( "Authorization", + "Basic " + btoa(username + ":" + password) + ) }, success: function(response){ return callback ? callback(request, response) : null; @@ -503,7 +492,7 @@ var OpenNebula = { }, "monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.Host.resource,false); - } + }, }, "Network": { @@ -577,7 +566,7 @@ var OpenNebula = { }, "fetch_template" : function(params){ OpenNebula.Action.show(params,OpenNebula.Network.resource,"template"); - } + }, }, "VM": { @@ -635,9 +624,6 @@ var OpenNebula = { "resubmit": function(params){ OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"resubmit"); }, - "poweroff" : function(params){ - OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"poweroff"); - }, "reboot" : function(params){ OpenNebula.Action.simple_action(params,OpenNebula.VM.resource,"reboot"); }, @@ -693,6 +679,9 @@ var OpenNebula = { "startvnc" : function(params){ OpenNebula.VM.vnc(params,"startvnc"); }, + "stopvnc" : function(params){ + OpenNebula.VM.vnc(params,"stopvnc"); + }, "monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.VM.resource,false); }, @@ -726,9 +715,6 @@ var OpenNebula = { }, "show" : function(params){ OpenNebula.Action.show(params,OpenNebula.Group.resource); - }, - "accounting" : function(params){ - OpenNebula.Action.monitor(params,OpenNebula.Group.resource,false); } }, @@ -772,13 +758,10 @@ var OpenNebula = { "fetch_template" : function(params){ OpenNebula.Action.show(params,OpenNebula.User.resource,"template"); }, - "accounting" : function(params){ - OpenNebula.Action.monitor(params,OpenNebula.User.resource,false); - }, "set_quota" : function(params){ var action_obj = { quotas : params.data.extra_param }; OpenNebula.Action.simple_action(params,OpenNebula.User.resource,"set_quota",action_obj); - } + }, // "addgroup" : function(params){ // var action_obj = {"group_id": params.data.extra_param }; @@ -1020,7 +1003,7 @@ var OpenNebula = { }, "fetch_template" : function(params){ OpenNebula.Action.show(params,OpenNebula.Datastore.resource,"template"); - } + }, }, "Marketplace" : { @@ -1048,8 +1031,8 @@ var OpenNebula = { }, error: function(res){ return callback_error ? callback_error(request, OpenNebula.Error(res)) : null; - } + }, }); - } - } + }, + }, } diff --git a/env/README.md b/stage/README.md similarity index 85% rename from env/README.md rename to stage/README.md index c26b894ef3..ff722c070d 100644 --- a/env/README.md +++ b/stage/README.md @@ -5,7 +5,7 @@ Installing services can sometimes be tedious. Getting the VM ins good shape, ins With this software we can script the installation and configuration of applications and services. You can also describe the services and their configuration that will be installed on a node so we can automate its installation. We will also be sure that each installation will be equal to other using the same configuration. -The tool oneenv will make use of [chef-solo](http://wiki.opscode.com/display/chef/Chef+Solo). It lets you register chef configurations and instantiate them using predefined templates and images. +The tool onestage will make use of [chef-solo](http://wiki.opscode.com/display/chef/Chef+Solo). It lets you register chef configurations and instantiate them using predefined templates and images. # Guide @@ -35,15 +35,15 @@ The node files are JSON encoded and contain the recipes that are going to be run ${WP_DB_NAME|wordpress} -oneenv comes with a template engine that will let you create node files with variables. These variables are named and can contain default values. the form is: +onestage comes with a template engine that will let you create node files with variables. These variables are named and can contain default values. the form is: ${NAME[|]} The name will be used to refer to it on VM instantiation (we will see this later on) and the default value will substitute the variable if it is not explicitly specified. -We save this file as node.json and now comes the registration part. oneenv will let us register it in the OpenNebula database. To register the node file we can use the command `oneenv create`: +We save this file as node.json and now comes the registration part. onestage will let us register it in the OpenNebula database. To register the node file we can use the command `onestage create`: - $ oneenv create node.json + $ onestage create node.json 21 The number returned is the identifier to our newly registered node file. We can also specify some parameters: @@ -54,19 +54,19 @@ The number returned is the identifier to our newly registered node file. We can On VM creation the recipes specified in the node file will be automatically downloaded from the standard chef cookbooks repository but we can specify a URL of a tar.gz containing extra cookbooks that you have created. For example: - $ oneenv create --name my_blog --templates ubuntu,centos --cookbooks http://some.url.com/cookbooks.tar.gz node.json + $ onestage create --name my_blog --templates ubuntu,centos --cookbooks http://some.url.com/cookbooks.tar.gz node.json 22 We can list the nodes we already have defined: - $ oneenv list + $ onestage list ID NAME 21 wordpress 22 my_blog And show the properties: - $ ./oneenv show my_blog + $ ./onestage show my_blog ROLE 22 INFORMATION ID : 22 NAME : my_blog @@ -107,11 +107,11 @@ And show the properties: There we can see the node file and its properties. It is also handy the default variables. Those are the ones we can change on instantiation. -We will be also able to update the node file using `oneenv update `. A text editor will be run letting us modify the node file. +We will be also able to update the node file using `onestage update `. A text editor will be run letting us modify the node file. -To instantiate a VM that will use this node we will use the command `oneenv instantiate