From 195f0e009f2b3ac412c294f2cce4d1c94ad1e620 Mon Sep 17 00:00:00 2001 From: James Adams Date: Thu, 5 Sep 2024 16:57:27 +0100 Subject: [PATCH] ncm-lbconfig: Remove obsolete component --- ncm-lbconfig/ChangeLog | 3 - ncm-lbconfig/pom.xml | 65 --------- .../pan/components/lbconfig/config-common.pan | 17 --- .../pan/components/lbconfig/config-rpm.pan | 16 --- .../main/pan/components/lbconfig/config.pan | 8 -- .../main/pan/components/lbconfig/schema.pan | 19 --- ncm-lbconfig/src/main/perl/lbconfig.pm | 128 ------------------ ncm-lbconfig/src/main/perl/lbconfig.pod | 40 ------ ncm-lbconfig/src/test/perl/00-load.t | 18 --- ncm-lbconfig/src/test/perl/pod-syntax.t | 6 - ncm-lbconfig/src/test/resources/ccm.cfg | 6 - pom.xml | 1 - 12 files changed, 327 deletions(-) delete mode 100644 ncm-lbconfig/ChangeLog delete mode 100644 ncm-lbconfig/pom.xml delete mode 100644 ncm-lbconfig/src/main/pan/components/lbconfig/config-common.pan delete mode 100644 ncm-lbconfig/src/main/pan/components/lbconfig/config-rpm.pan delete mode 100644 ncm-lbconfig/src/main/pan/components/lbconfig/config.pan delete mode 100755 ncm-lbconfig/src/main/pan/components/lbconfig/schema.pan delete mode 100755 ncm-lbconfig/src/main/perl/lbconfig.pm delete mode 100755 ncm-lbconfig/src/main/perl/lbconfig.pod delete mode 100644 ncm-lbconfig/src/test/perl/00-load.t delete mode 100644 ncm-lbconfig/src/test/perl/pod-syntax.t delete mode 100644 ncm-lbconfig/src/test/resources/ccm.cfg diff --git a/ncm-lbconfig/ChangeLog b/ncm-lbconfig/ChangeLog deleted file mode 100644 index 386a64a8..00000000 --- a/ncm-lbconfig/ChangeLog +++ /dev/null @@ -1,3 +0,0 @@ -2010-10-01 (Version 1.0.0) -- B. Gamma - - Initial version of component. diff --git a/ncm-lbconfig/pom.xml b/ncm-lbconfig/pom.xml deleted file mode 100644 index 9cef5f59..00000000 --- a/ncm-lbconfig/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - - org.quattor.cfg.module - lbconfig - - pom - 23.9.0-rc2-SNAPSHOT - lbconfig NCM component. - - - org.quattor.maven - build-profile - 1.62 - - - - - - Apache 2 License - http://www.opensource.org/licenses/apache2.0 - Copyright (c) Responsible Organization - - - - - - Charles Loomis - charles.loomis@cern.ch - - - - - - Jane SMITH - smith@example.com - - author - - - - Joe DOE - doe@example.org - - author - - - - - - - - - org.codehaus.mojo - rpm-maven-plugin - - https://github.com/quattor/configuration-modules-grid/tree/master/ncm-${project.artifactId} - - - - - - - diff --git a/ncm-lbconfig/src/main/pan/components/lbconfig/config-common.pan b/ncm-lbconfig/src/main/pan/components/lbconfig/config-common.pan deleted file mode 100644 index b17f3c02..00000000 --- a/ncm-lbconfig/src/main/pan/components/lbconfig/config-common.pan +++ /dev/null @@ -1,17 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} -# ${build-info} - -unique template components/${project.artifactId}/config-common; - -include 'components/${project.artifactId}/schema'; - -# Set prefix to root of component configuration. -prefix '/software/components/${project.artifactId}'; - -'version' = '${no-snapshot-version}'; -#'package' = 'NCM::Component'; - -'active' ?= true; -'dispatch' ?= true; diff --git a/ncm-lbconfig/src/main/pan/components/lbconfig/config-rpm.pan b/ncm-lbconfig/src/main/pan/components/lbconfig/config-rpm.pan deleted file mode 100644 index e73eef2a..00000000 --- a/ncm-lbconfig/src/main/pan/components/lbconfig/config-rpm.pan +++ /dev/null @@ -1,16 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} -# ${build-info} - -unique template components/${project.artifactId}/config-rpm; - -include 'components/${project.artifactId}/config-common'; - -# Set prefix to root of component configuration. -prefix '/software/components/${project.artifactId}'; - -# Install Quattor configuration module via RPM package. -'/software/packages' = pkg_repl('ncm-${project.artifactId}', '${no-snapshot-version}-${rpm.release}', 'noarch'); -'dependencies/pre' ?= list('spma'); - diff --git a/ncm-lbconfig/src/main/pan/components/lbconfig/config.pan b/ncm-lbconfig/src/main/pan/components/lbconfig/config.pan deleted file mode 100644 index 4625b0f8..00000000 --- a/ncm-lbconfig/src/main/pan/components/lbconfig/config.pan +++ /dev/null @@ -1,8 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} -# ${build-info} - -unique template components/${project.artifactId}/config; - -include 'components/${project.artifactId}/config-rpm'; diff --git a/ncm-lbconfig/src/main/pan/components/lbconfig/schema.pan b/ncm-lbconfig/src/main/pan/components/lbconfig/schema.pan deleted file mode 100755 index 4081d94e..00000000 --- a/ncm-lbconfig/src/main/pan/components/lbconfig/schema.pan +++ /dev/null @@ -1,19 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} -# ${build-info} -# - -declaration template components/lbconfig/schema; - -include 'quattor/schema'; - -type structure_index_list = string[]; - -type ${project.artifactId}_component = { - include structure_component - 'configFile' : string = 'edg_wl_query_index.conf' - 'indicies' : structure_index_list{} = dict('system', list('owner', 'location', 'destination')) -}; - -bind '/software/components/${project.artifactId}' = ${project.artifactId}_component; diff --git a/ncm-lbconfig/src/main/perl/lbconfig.pm b/ncm-lbconfig/src/main/perl/lbconfig.pm deleted file mode 100755 index 80677c59..00000000 --- a/ncm-lbconfig/src/main/perl/lbconfig.pm +++ /dev/null @@ -1,128 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} -# ${build-info} -# - -package NCM::Component::lbconfig; - -use strict; -use NCM::Component; -use vars qw(@ISA $EC); -@ISA = qw(NCM::Component); -$EC=LC::Exception::Context->new->will_store_all; -use NCM::Check; -use File::Copy; - - -########################################################################## -sub Configure($$@) { -########################################################################## - - my ($self, $config) = @_; - - # Define paths for convenience. - my $base = "/software/components/lbconfig"; - my $edgpath = "/system/edg/config/EDG_LOCATION"; - my $edgvarpath = "/system/edg/config/EDG_LOCATION_VAR"; - - # Default location for EDG software. - my $edgloc = "/opt/edg"; - if ($config->elementExists($edgpath)) { - $edgloc = $config->getValue($edgpath); - } - - # Default location for EDG var area. - my $varloc = "$edgloc/var"; - if ($config->elementExists($edgvarpath)) { - $varloc = $config->getValue($edgvarpath); - } - - # Ensure that the configuration path exists. - my $etcpath = "$varloc/etc"; - mkpath($etcpath,0,0755) unless (-d $etcpath); - unless (-d $etcpath) { - $self->error("$etcpath can't be created"); - return 1; - } - - # Save the date. - my $date = localtime(); - - # Create the sqlFile configuration. - # Collect all of the indicies. - my @indicies; - if ($config->elementExists("$base/indicies")) { - my %hash = $config->getElement("$base/indicies")->getHash(); - foreach my $type (sort keys %hash) { - my @names = $hash{$type}->getList(); - foreach (@names) { - my $name = $_->getValue(); - push @indicies, "[type = \"$type\"; name = \"$name\"]"; - } - } - } - - # ClassAds doesn't appear to take any comment syntax. - my $contents = "[\n"; - $contents .= "JobIndices = {\n"; - $contents .= join(",\n", @indicies); - $contents .= "\n}\n"; - $contents .= "]\n"; - - # Create/update the configuration file. - my $fname = "$etcpath/" . $config->getValue("$base/configFile"); - $self->createConfig($fname, $contents); - - # Ensure that the configuration path exists. - my $cfgpath = "$varloc/etc/profile.d"; - mkpath($cfgpath,0,0755) unless (-d $cfgpath); - unless (-d $cfgpath) { - $self->error("$cfgpath can't be created"); - return 1; - } - - # Copy profile.d scripts into var area. - my $srcfile = "$edgloc/etc/profile.d/edg-wl-lbserver-rgma-env.sh"; - my $dstfile = "$cfgpath/edg-wl-lbserver-rgma-env.sh"; - copy($srcfile, $dstfile); - if ($?) { - $self->error("problem copying $srcfile to $dstfile"); - } - - # Execute the configure script. - my $cmd = "$edgloc/sbin/edg-wl-bkindex -r $fname"; - system($cmd); - if ($?) { - $self->error("error executing command: $cmd"); - } - return 1; -} - -sub createConfig { - - my ($self, $fname, $contents) = @_; - - # Now just create the new configuration file. Be careful to save - # a backup of the previous file if necessary. - if ( ! -e $fname ) { - - # Configuration file doesn't exist yet. Create it. - open CONF, ">$fname"; - print CONF $contents; - close (CONF); - $self->log("$fname created"); - - } else { - - # Already exists. Make backup and create new file. - my $result = LC::Check::file( $fname, - backup => ".old", - contents => $contents, - ); - $self->log("$fname updated") if $result; - } -}; - - -1; # Required for PERL modules diff --git a/ncm-lbconfig/src/main/perl/lbconfig.pod b/ncm-lbconfig/src/main/perl/lbconfig.pod deleted file mode 100755 index 6581cf97..00000000 --- a/ncm-lbconfig/src/main/perl/lbconfig.pod +++ /dev/null @@ -1,40 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} -# ${build-info} -# - -=head1 NAME - -ncm-lbconfig: NCM lbconfig component - -=head1 DESCRIPTION - -The I component manages the configuration file of the WP1 -lbserver. It creates the /opt/edg/etc/edg_wl_query_index file with -the values saved in the machine profile. - -=head1 RESOURCES - -=head2 configFile (edg_wl_query_index.conf) - -The name of the configuration file. It will be created in the -location EDG_LOCATION/etc. - -=head2 type (system) - -The type of the resource. - -=head2 owner - -The owner. - -=head2 location - -The location. - -=head2 destination - -The destination. - -=cut diff --git a/ncm-lbconfig/src/test/perl/00-load.t b/ncm-lbconfig/src/test/perl/00-load.t deleted file mode 100644 index e4efd0b5..00000000 --- a/ncm-lbconfig/src/test/perl/00-load.t +++ /dev/null @@ -1,18 +0,0 @@ -# ${license-info} -# ${author-info} -# ${build-info} - -=pod - -=head1 Smoke test - -Basic test that ensures that our module will load correctly. - -=cut - -use strict; -use warnings; -use Test::More tests => 1; -use Test::Quattor; - -use_ok("NCM::Component::lbconfig"); diff --git a/ncm-lbconfig/src/test/perl/pod-syntax.t b/ncm-lbconfig/src/test/perl/pod-syntax.t deleted file mode 100644 index a7864338..00000000 --- a/ncm-lbconfig/src/test/perl/pod-syntax.t +++ /dev/null @@ -1,6 +0,0 @@ - -use Test::More; -use Test::Pod; - -my @dirs = qw(target/lib/perl); -all_pod_files_ok(all_pod_files(@dirs)); diff --git a/ncm-lbconfig/src/test/resources/ccm.cfg b/ncm-lbconfig/src/test/resources/ccm.cfg deleted file mode 100644 index d0aebda3..00000000 --- a/ncm-lbconfig/src/test/resources/ccm.cfg +++ /dev/null @@ -1,6 +0,0 @@ -debug 0 -get_timeout 1 -profile https://www.google.com -cache_root target/test/cache -retrieve_wait 0 -retrieve_retries 1 diff --git a/pom.xml b/pom.xml index 95e511cc..d63316bf 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,6 @@ ncm-globuscfg ncm-gridmapdir ncm-gsissh - ncm-lbconfig ncm-lcas ncm-lcgbdii ncm-lcgmonjob