Permalink
Browse files

Merge remote branch 'upstream/master' into spotinstances

  • Loading branch information...
2 parents a21fc50 + e9c7ac0 commit ea64cc4123f7d6ba499547c3a2e6796f81bc8b39 @pauloricardomg pauloricardomg committed Jul 22, 2010
View
8 cloud-client/nimbus-cloud-client-src/samples/ec2basecluster.xml
@@ -21,8 +21,8 @@
<identity>
<_interface>localnic</_interface>
</identity>
- <role interface="localnic">torquemaster</role>
- <role interface="localnic">nfsserver</role>
+ <role _interface="localnic">torquemaster</role>
+ <role _interface="localnic">nfsserver</role>
</provides>
<requires>
@@ -64,8 +64,8 @@ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA2Uoxji01ETQAllCL/7z0Q26h81cW1DKKhhJG3ZSttq3h
<identity>
<_interface>localnic</_interface>
</identity>
- <role interface="localnic">torqueslave</role>
- <role interface="localnic">nfsclient</role>
+ <role _interface="localnic">torqueslave</role>
+ <role _interface="localnic">nfsclient</role>
</provides>
<requires>
View
54 cumulus/cb/pycb/tools/base_repo.py
@@ -5,61 +5,37 @@
import os
import sys
import nose.tools
-import boto
-from boto.s3.connection import OrdinaryCallingFormat
-from boto.s3.connection import VHostCallingFormat
-from boto.s3.connection import SubdomainCallingFormat
import sys
from ConfigParser import SafeConfigParser
from pycb.cumulus import *
import time
import pycb.test_common
import pynimbusauthz
+from pynimbusauthz.user import User
+from pynimbusauthz.objects import File
+from pynimbusauthz.db import DB
import unittest
import tempfile
import filecmp
-from pycb.cumulus import *
-from boto.s3.connection import OrdinaryCallingFormat
-from boto.s3.connection import S3Connection
-
-
-def setup_options(argv):
-
- u = """[options] <admin name> <repo dir>
-Create a base repository directory with public write permissions
- """
- (parser, all_opts) = pynimbusauthz.get_default_options(u)
-
- (o, args) = pynimbusauthz.parse_args(parser, all_opts, argv)
-
- if len(args) < 2:
- pynimbusauthz.parse_args(parser, all_opts, ["--help"])
-
- return (o, args)
def main(argv=sys.argv[1:]):
- (o, args) = setup_options(argv)
- # make the user that will create the dir
- id = pycb.test_common.random_string(21)
- pw = pycb.test_common.random_string(42)
- auth = pycb.config.auth
-
- display_name = args[0]
- repo_dir = args[1]
- auth.create_user(display_name, id, pw, None)
-
- print "admin s3 id is: %s" % (id)
- print "admin s3 pw: %s" % (pw)
-
- cf = OrdinaryCallingFormat()
- conn = S3Connection(id, pw, host=pycb.config.hostname, port=pycb.config.port, is_secure=pycb.config.use_https, calling_format=cf)
+ try:
+ repo_dir = argv[0]
+ con_str = pynimbusauthz.get_db_connection_string()
+ db_obj = DB(con_str=con_str)
- bucket = conn.create_bucket(repo_dir, policy='public-read-write')
-
+ user = User(db_obj, uu="CumulusPublicUser")
+ if user == None:
+ raise Exception("No public user")
+ File.create_file(db_obj, repo_dir, user, repo_dir, pynimbusauthz.alias_type_s3)
+ db_obj.commit()
+ except:
+ raise
+ return 0
if __name__ == "__main__":
rc = main()
View
8 docs/src/examples/ec2basecluster.xml
@@ -21,8 +21,8 @@
<identity>
<_interface>localnic</_interface>
</identity>
- <role interface="localnic">torquemaster</role>
- <role interface="localnic">nfsserver</role>
+ <role _interface="localnic">torquemaster</role>
+ <role _interface="localnic">nfsserver</role>
</provides>
<requires>
@@ -64,8 +64,8 @@ ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA2Uoxji01ETQAllCL/7z0Q26h81cW1DKKhhJG3ZSttq3h
<identity>
<_interface>localnic</_interface>
</identity>
- <role interface="localnic">torqueslave</role>
- <role interface="localnic">nfsclient</role>
+ <role _interface="localnic">torqueslave</role>
+ <role _interface="localnic">nfsclient</role>
</provides>
<requires>
View
2 home/libexec/nimbus_list_users.py
@@ -58,7 +58,7 @@ def setup_options(argv):
opt = cbOpts("report", "r", "Report the selected columns from the following: " + pycb.tools.report_options_to_string(g_report_options), pycb.tools.report_options_to_string(g_report_options))
all_opts.append(opt)
- opt = cbOpts("delim", "D", "Character between columns in the report", ",")
+ opt = cbOpts("delim", "D", "Character between columns in the batch mode report. This options is only relevant when used with -b", ",")
all_opts.append(opt)
(o, args) = pynimbusauthz.parse_args(parser, all_opts, argv)
View
27 libexec/install-real.sh
@@ -41,34 +41,25 @@ echo "Creating Cumulus repository with the following commands:"
echo ""
export CUMULUS_SETTINGS_FILE=$NIMBUS_HOME/cumulus/etc/cumulus.ini
+CUMULUS_ENV="$NIMBUS_HOME/cumulus/env.sh"
+if [ ! -f $CUMULUS_ENV ]; then
+ echo "Expected file to be created: $CUMULUS_ENV"
+ exit 1
+fi
-REPOCMD1="$NIMBUS_HOME/bin/nimbusctl cumulus start"
-REPOCMD2="$NIMBUS_HOME/ve/bin/cumulus-create-repo-admin nimbusadmin@${CUMULUS_HOST} $CUMULUS_REPO_BUCKET"
-REPOCMD3="$NIMBUS_HOME/bin/nimbusctl cumulus stop"
+source $CUMULUS_ENV
+REPOCMD="$NIMBUS_HOME/ve/bin/cumulus-create-repo-admin $CUMULUS_REPO_BUCKET"
-echo " $REPOCMD1"
-echo " $REPOCMD2"
-echo " $REPOCMD3"
+echo " $REPOCMD"
echo ""
-$REPOCMD1
-if [ $? -ne 0 ]; then
- echo "Could not start Cumulus."
- exit 1
-fi
-
-$REPOCMD2 >/dev/null
+$REPOCMD >/dev/null
if [ $? -ne 0 ]; then
echo "Could not create Cumulus repository."
exit 1
fi
echo "Created repo admin."
-$REPOCMD3
-if [ $? -ne 0 ]; then
- echo "Could not stop Cumulus? (continuing)"
-fi
-
echo ""
GUIDEURL=`$NIMBUS_HOME/bin/nimbus-version --guide`
if [ $? -ne 0 ]; then

0 comments on commit ea64cc4

Please sign in to comment.