[Swift-commit] r3544 - in usertools/swift/swiftconfig: bin etc
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Mon Aug 16 13:17:07 CDT 2010
Author: davidk
Date: 2010-08-16 13:17:07 -0500 (Mon, 16 Aug 2010)
New Revision: 3544
Modified:
usertools/swift/swiftconfig/bin/swiftconfig
usertools/swift/swiftconfig/etc/TODO
Log:
Replaced -templates and -describe with -list
swiftconfig -list templates
swiftconfig -list configs
swiftconfig -list <sitename>
Modified: usertools/swift/swiftconfig/bin/swiftconfig
===================================================================
--- usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 17:40:59 UTC (rev 3543)
+++ usertools/swift/swiftconfig/bin/swiftconfig 2010-08-16 18:17:07 UTC (rev 3544)
@@ -16,7 +16,7 @@
use Data::Dumper;
# Variables used for sites.xml
-my $option_templates = q{}; # List all templates
+my $option_list = q{}; # List information about config
my $option_remove = q{}; # Remove entry from sites.xml
my $option_edit = q{}; # Edit mode
my $option_sites = q{}; # List all usable sites
@@ -30,7 +30,6 @@
# Assign variables from command line options
GetOptions(
'remove=s' => \$option_remove,
- 'templates' => \$option_templates,
'sites' => \$option_sites,
'describe=s' => \$option_describe,
'default|defaults' => \$option_default,
@@ -40,6 +39,7 @@
'copy=s' => \$option_copy,
'apps|applications' => \$option_applications,
'import=s' => \$option_import,
+ 'list=s' => \$option_list,
'help|man' => sub { pod2usage(-verbose => 2); },
);
@@ -95,15 +95,6 @@
}
}
-# Describe a site
-if ($option_describe) {
- my $site_file = "$dotswift_directory/sites/$option_describe/sites.xml";
- if ( !-e $site_file ) {
- die "Unable to locate configuration for $option_describe\n";
- }
- system("cat $site_file");
-}
-
# Remove an entry
if ($option_remove) {
@@ -117,11 +108,6 @@
. "$dotswift_directory/sites/$option_remove\n";
}
-# List all available templates
-if ($option_templates) {
- print_directory($template_directory);
-}
-
# List all user-added sites
if ($option_sites) {
print_directory("$dotswift_directory/sites");
@@ -299,7 +285,22 @@
}
}
+if($option_list) {
+ if ($option_list eq "templates") {
+ print_directory($template_directory);
+ }
+ elsif ($option_list eq "configs") {
+ print_directory("$dotswift_directory/sites");
+ }
+ # Assume it's the name of a configuration
+ else {
+ my @matched_configs = glob("$dotswift_directory/sites/$option_list");
+ foreach my $site (@matched_configs) {
+ system("cat $site/sites.xml");
+ }
+ }
+}
__END__
=head1 NAME
@@ -324,10 +325,12 @@
-templates Display all available templates
-sites Displays all existing configurations
-edit site Specifies the name of a configuration to edit
- -describe site Prints the raw XML site configuration
-copy site Copies a configuration
-default Do not prompt for values, always use defaults
-full Edit every available configuration option
+ -import Import a sites.xml file into swiftconfig
+ -list Options: templates, configs, or a config
+ -apps Edit or create application sets
=head1 EXAMPLES
@@ -342,4 +345,17 @@
Remove a site
swiftconfig -remove teraport
+
+Edit application sets
+ swiftconfig -apps
+
+List available templates
+ swiftconfig -list templates
+
+List all configurations
+ swiftconfig -list configs
+
+List information about one particular configuration
+ swiftconfig -list configuration_name
+
=cut
Modified: usertools/swift/swiftconfig/etc/TODO
===================================================================
--- usertools/swift/swiftconfig/etc/TODO 2010-08-16 17:40:59 UTC (rev 3543)
+++ usertools/swift/swiftconfig/etc/TODO 2010-08-16 18:17:07 UTC (rev 3544)
@@ -1,9 +1,6 @@
Running and testing on more setups, OSG, teragrid, others
-
Job tagging with search capabilities
-
Ability to group groups of sites (other than 'all')
-
Have swiftrun be flexible enough to work for new users, as well as advanced users
-
-swiftconfig -import to allow integration with existing configurations
+Site aliases
+Ability to "undo" edits
More information about the Swift-commit
mailing list