From 2349e9563a95608f9d9cd2ddbc64f1d4c9b1b65b Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 2 Jul 2009 08:01:21 +0000 Subject: [PATCH] cleaning up config files --- INSTALL.txt | 4 ++-- cmdline/configSfi.sh | 13 ------------- cmdline/demoAggregate.sh | 19 ++++++++++--------- cmdline/sfi.py | 2 ++ cmdline/testSfi.sh | 8 +++++--- cmdline/testSfiDelegate.sh | 8 +++++--- cmdline/testSfiSliceRegister.sh | 28 ++++++++++++++-------------- {geni => config}/aggregates.xml | 0 config/config_sfi | 16 ++++++++++++++++ {geni => config}/registries.xml | 0 geniwrapper.spec | 4 ++++ setup.py | 2 +- 12 files changed, 59 insertions(+), 45 deletions(-) delete mode 100644 cmdline/configSfi.sh rename {geni => config}/aggregates.xml (100%) create mode 100644 config/config_sfi rename {geni => config}/registries.xml (100%) diff --git a/INSTALL.txt b/INSTALL.txt index 2ff74dab..20256545 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -77,13 +77,13 @@ Use: Copy my private PL (RSA) ssh key to ~/.sfi/quetier.pkey in cmdline -edit configSfi.sh +edit config_sfi export SFI_AUTH=ple.upmc export SFI_USER=$SFI_AUTH.quetier export SFI_REGISTRY=http://138.96.255.199:12345/ export SFI_SM=http://138.96.255.199:12346/ -source configSfi.sh +source config_sfi ./sfi.py list ple ./sfi.py show ple.upmc.quetier diff --git a/cmdline/configSfi.sh b/cmdline/configSfi.sh deleted file mode 100644 index 07ec014d..00000000 --- a/cmdline/configSfi.sh +++ /dev/null @@ -1,13 +0,0 @@ -#export SFI_AUTH=planetlab.us.arizona -#export SFI_USER=$SFI_AUTH.Baker_Scott - -#export TEST_USER_2=$SFI_AUTH.Hartman_John - -export SFI_AUTH=plc.princeton -export SFI_USER=$SFI_AUTH.faiyaza - -export SFI_REGISTRY=http://128.112.139.120:12345/ -#export SFI_SM=http://128.112.139.120:12347/ - -#export SFI_REGISTRY=http://www.planet-lab.org:12345/ -export SFI_SM=http://www.planet-lab.org:12347/ diff --git a/cmdline/demoAggregate.sh b/cmdline/demoAggregate.sh index 9749d3b7..14e50c2e 100644 --- a/cmdline/demoAggregate.sh +++ b/cmdline/demoAggregate.sh @@ -1,8 +1,9 @@ #!/bin/bash -source configSfi.sh +export PATH=$PATH:/etc/geni +source config_sfi +CWD=$(pwd) -CWD=`pwd` DEMO_AUTH='planetlab.us' DEMO_PL_AUTH='planetlab.us.pl' @@ -10,45 +11,45 @@ echo XXXXX ------------------------------------------------ echo XXXXX list contents of authority echo XXXXX ------------------------------------------------ -python ./sfi.py list $DEMO_PL_AUTH +python $(CWD)/sfi.py list $DEMO_PL_AUTH echo XXXXX ------------------------------------------------ echo XXXXX show contents of authority echo XXXXX ------------------------------------------------ -python ./sfi.py show $DEMO_PL_AUTH +python $(CWD)/sfi.py show $DEMO_PL_AUTH echo XXXXX ------------------------------------------------ echo XXXXX show users authority echo XXXXX ------------------------------------------------ -python ./sfi.py show $DEMO_PL_AUTH +python $(CWD)/sfi.py show $DEMO_PL_AUTH echo XXXXX ------------------------------------------------ echo XXXXX list available node +rspec+ echo XXXXX ------------------------------------------------ -python ./sfi.py nodes +python $(CWD)/sfi.py nodes echo XXXXX ------------------------------------------------ echo XXXXX list available node +dns+ echo XXXXX ------------------------------------------------ -python ./sfi.py nodes dns +python $(CWD)/sfi.py nodes dns echo XXXXX ------------------------------------------------ echo XXXXX list slices at the aggregate echo XXXXX ------------------------------------------------ -python ./sfi.py slices +python $(CWD)/sfi.py slices echo XXXXX ------------------------------------------------ echo XXXXX list resources being used by pl_tmack echo XXXXX ------------------------------------------------ -python ./sfi.py resources planetlab.us.pl.tmack +python $(CWD)/sfi.py resources planetlab.us.pl.tmack diff --git a/cmdline/sfi.py b/cmdline/sfi.py index 47fb18e6..a8dfeb5b 100755 --- a/cmdline/sfi.py +++ b/cmdline/sfi.py @@ -15,6 +15,8 @@ from geni.util.record import * from geni.util.rspec import Rspec from types import StringTypes, ListType +# xxx todo xxx auto-load ~/.sfi/config_sfi + sfi_dir = os.path.expanduser("~/.sfi/") slicemgr = None registry = None diff --git a/cmdline/testSfi.sh b/cmdline/testSfi.sh index f47c8dae..a82524ca 100644 --- a/cmdline/testSfi.sh +++ b/cmdline/testSfi.sh @@ -1,10 +1,12 @@ #!/bin/bash -source configSfi.sh +export PATH=$PATH:/etc/geni +source config_sfi +CWD=$(pwd) rm -f saved_record.* -python ./sfi.py show -o saved_record.$SFI_USER $SFI_USER -python ./sfi.py list -o saved_record.$SFI_AUTH $SFI_AUTH +python $(CWD)/sfi.py show -o saved_record.$SFI_USER $SFI_USER +python $(CWD)/sfi.py list -o saved_record.$SFI_AUTH $SFI_AUTH #rm -f saved_record.* diff --git a/cmdline/testSfiDelegate.sh b/cmdline/testSfiDelegate.sh index 567856e2..4eb72e91 100644 --- a/cmdline/testSfiDelegate.sh +++ b/cmdline/testSfiDelegate.sh @@ -1,10 +1,12 @@ #!/bin/bash -source configSfi.sh +export PATH=$PATH:/etc/geni +source config_sfi +CWD=$(pwd) rm -f saved_record.* -python ./sfi.py show $SFI_USER -python ./sfi.py delegate --user plc.arizona.gackscentral +python $(CWD)/sfi.py show $SFI_USER +python $(CWD)/sfi.py delegate --user plc.arizona.gackscentral #rm -f saved_record.* diff --git a/cmdline/testSfiSliceRegister.sh b/cmdline/testSfiSliceRegister.sh index 56e4aa5b..24470369 100644 --- a/cmdline/testSfiSliceRegister.sh +++ b/cmdline/testSfiSliceRegister.sh @@ -1,8 +1,8 @@ #!/bin/bash -source configSfi.sh - -CWD=`pwd` +export PATH=$PATH:/etc/geni +source config_sfi +CWD=$(pwd) # private key to use when creating GID for new slice export TEST_KEY=$CWD/testkey.pkey @@ -18,61 +18,61 @@ echo XXXXX Removing the test slice. this will cause an error if the slice does echo XXXXX not exist -- this error can be ignored echo XXXXX ------------------------------------------------------------------- -python ./sfi.py remove --type slice $TEST_SLICE_HRN +python $(CWD)/sfi.py remove --type slice $TEST_SLICE_HRN echo XXXXX ------------------------------------------------------------------- echo XXXXX Creating a record for the test slice echo XXXXX ------------------------------------------------------------------- -python ./editRecord.py --hrn $TEST_SLICE_HRN --pubkeyfile $TEST_KEY --type slice --addresearcher $SFI_USER --outfile $TEST_SLICE_RECORD +python $(CWD)/editRecord.py --hrn $TEST_SLICE_HRN --pubkeyfile $TEST_KEY --type slice --addresearcher $SFI_USER --outfile $TEST_SLICE_RECORD echo XXXXX ------------------------------------------------------------------- echo XXXXX Adding the test slice, $TEST_SLICE_HRN echo XXXXX ------------------------------------------------------------------- -python ./sfi.py add $TEST_SLICE_RECORD +python $(CWD)/sfi.py add $TEST_SLICE_RECORD echo XXXXX ------------------------------------------------------------------- echo XXXXX The slice should have one researcher, $SFI_USER echo XXXXX ------------------------------------------------------------------- -python ./sfi.py show $TEST_SLICE_HRN +python $(CWD)/sfi.py show $TEST_SLICE_HRN echo XXXXX ------------------------------------------------------------------- echo XXXXX Adding $TEST_USER_2 to the slice researchers echo XXXXX ------------------------------------------------------------------- -python ./editRecord.py --infile $TEST_SLICE_RECORD --outfile $TEST_SLICE_RECORD --addresearcher $TEST_USER_2 +python $(CWD)/editRecord.py --infile $TEST_SLICE_RECORD --outfile $TEST_SLICE_RECORD --addresearcher $TEST_USER_2 echo XXXXX ------------------------------------------------------------------- echo XXXXX Updating the slice echo XXXXX ------------------------------------------------------------------- -python ./sfi.py update $TEST_SLICE_RECORD +python $(CWD)/sfi.py update $TEST_SLICE_RECORD echo XXXXX ------------------------------------------------------------------- echo XXXXX The slice record should now have two users: $SFI_USER, $TEST_USER_2 echo XXXXX ------------------------------------------------------------------- -python ./sfi.py show $TEST_SLICE_HRN +python $(CWD)/sfi.py show $TEST_SLICE_HRN echo XXXXX ------------------------------------------------------------------- echo XXXXX Removing $SFI_USER from the slice researchers echo XXXXX ------------------------------------------------------------------- -python ./editRecord.py --infile $TEST_SLICE_RECORD --outfile $TEST_SLICE_RECORD --delresearcher $SFI_USER +python $(CWD)/editRecord.py --infile $TEST_SLICE_RECORD --outfile $TEST_SLICE_RECORD --delresearcher $SFI_USER echo XXXXX ------------------------------------------------------------------- echo XXXXX Updating the slice echo XXXXX ------------------------------------------------------------------- -python ./sfi.py update $TEST_SLICE_RECORD +python $(CWD)/sfi.py update $TEST_SLICE_RECORD echo XXXXX ------------------------------------------------------------------- echo XXXXX The slice record should now have one users: $TEST_USER_2 echo XXXXX ------------------------------------------------------------------- -python ./sfi.py show $TEST_SLICE_HRN +python $(CWD)/sfi.py show $TEST_SLICE_HRN echo XXXXX ------------------------------------------------------------------- echo XXXXX Updating the slice @@ -80,5 +80,5 @@ echo XXXXX ... this verifies escalation from slice_cred to auth_cred echo XXXXX ------------------------------------------------------------------- rm ~/.sfi/slice_testslice.cred -python ./sfi.py update $TEST_SLICE_RECORD +python $(CWD)/sfi.py update $TEST_SLICE_RECORD diff --git a/geni/aggregates.xml b/config/aggregates.xml similarity index 100% rename from geni/aggregates.xml rename to config/aggregates.xml diff --git a/config/config_sfi b/config/config_sfi new file mode 100644 index 00000000..b1484730 --- /dev/null +++ b/config/config_sfi @@ -0,0 +1,16 @@ +# user-level configuration for sfi + +### hrn of your authority +export SFI_AUTH=plc.princeton +# or planetlab.us.arizona + +### your user hrn +export SFI_USER=plc.princeton.faiyaza +# or planetlab.us.arizona.Baker_Scott +# or planetlab.us.arizona.Hartman_John + +### where to find the registry +export SFI_REGISTRY=http://www.planet-lab.org:12345/ + +# where to find the slice manager +export SFI_SM=http://www.planet-lab.org:12347/ diff --git a/geni/registries.xml b/config/registries.xml similarity index 100% rename from geni/registries.xml rename to config/registries.xml diff --git a/geniwrapper.spec b/geniwrapper.spec index 9f1b85fb..c1e9943a 100644 --- a/geniwrapper.spec +++ b/geniwrapper.spec @@ -53,6 +53,10 @@ rm -rf $RPM_BUILD_ROOT %files -f GENI_INSTALLED_FILES.all %defattr(-,root,root) /usr/share/keyconvert +%config (noreplace) /etc/geni/geni_config +%config (noreplace) /etc/geni/sfi_config +%config (noreplace) /etc/geni/aggregates.xml +%config (noreplace) /etc/geni/registries.xml %post chmod 0744 /etc/init.d/geniwrapper diff --git a/setup.py b/setup.py index bd2fcaaf..ed2c7571 100755 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ import shutil version = '0.2' scripts = ['geni/gimport.py', 'geni/plc.py', 'cmdline/sfi.py', 'config/geni-config-tty'] package_dirs = ['geni', 'geni/util', 'geni/methods'] -data_files = [('/etc/geni/', ['geni/aggregates.xml', 'geni/registries.xml', 'config/geni_config', 'cmdline/configSfi.sh']), +data_files = [('/etc/geni/', ['config/aggregates.xml', 'config/registries.xml', 'config/geni_config', 'config/config_sfi']), ('/etc/init.d/', ['geni/geniwrapper'])] symlinks = ['/usr/share/geniwrapper'] initscripts = ['/etc/init.d/geniwrapper'] -- 2.43.0