From 8abc359712ed59c8789d57dc28015729eee8e961 Mon Sep 17 00:00:00 2001 From: James Adams Date: Thu, 5 Sep 2024 16:27:08 +0100 Subject: [PATCH] ncm-maui: Remove obsolete component Resolves #85. --- ncm-maui/ChangeLog | 3 - ncm-maui/pom.xml | 65 ----------------- .../src/main/pan/components/maui/config.pan | 19 ----- .../src/main/pan/components/maui/schema.pan | 14 ---- ncm-maui/src/main/perl/maui.pm | 70 ------------------- ncm-maui/src/main/perl/maui.pod | 33 --------- ncm-maui/src/test/perl/00-load.t | 18 ----- ncm-maui/src/test/perl/pod-syntax.t | 6 -- ncm-maui/src/test/perl/simple.t | 35 ---------- ncm-maui/src/test/resources/ccm.cfg | 6 -- ncm-maui/src/test/resources/simple.pan | 11 --- pom.xml | 1 - 12 files changed, 281 deletions(-) delete mode 100644 ncm-maui/ChangeLog delete mode 100644 ncm-maui/pom.xml delete mode 100644 ncm-maui/src/main/pan/components/maui/config.pan delete mode 100644 ncm-maui/src/main/pan/components/maui/schema.pan delete mode 100755 ncm-maui/src/main/perl/maui.pm delete mode 100755 ncm-maui/src/main/perl/maui.pod delete mode 100644 ncm-maui/src/test/perl/00-load.t delete mode 100644 ncm-maui/src/test/perl/pod-syntax.t delete mode 100644 ncm-maui/src/test/perl/simple.t delete mode 100644 ncm-maui/src/test/resources/ccm.cfg delete mode 100644 ncm-maui/src/test/resources/simple.pan diff --git a/ncm-maui/ChangeLog b/ncm-maui/ChangeLog deleted file mode 100644 index 386a64a8..00000000 --- a/ncm-maui/ChangeLog +++ /dev/null @@ -1,3 +0,0 @@ -2010-10-01 (Version 1.0.0) -- B. Gamma - - Initial version of component. diff --git a/ncm-maui/pom.xml b/ncm-maui/pom.xml deleted file mode 100644 index 1a148444..00000000 --- a/ncm-maui/pom.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - 4.0.0 - - org.quattor.cfg.module - maui - - pom - 23.9.0-rc2-SNAPSHOT - Maui 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-maui/src/main/pan/components/maui/config.pan b/ncm-maui/src/main/pan/components/maui/config.pan deleted file mode 100644 index 8a8a9607..00000000 --- a/ncm-maui/src/main/pan/components/maui/config.pan +++ /dev/null @@ -1,19 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} - -unique template components/${project.artifactId}/config; - -include 'components/${project.artifactId}/schema'; - -bind '/software/components/maui' = ${project.artifactId}_component; - -# Set prefix to root of component configuration. -prefix '/software/components/${project.artifactId}'; -'version' = '${no-snapshot-version}'; -'active' ?= true; -'dispatch' ?= true; -'dependencies/pre' ?= list('spma'); - -# Install Quattor configuration module via RPM package. -'/software/packages' = pkg_repl('ncm-${project.artifactId}', '${no-snapshot-version}-${rpm.release}', 'noarch'); diff --git a/ncm-maui/src/main/pan/components/maui/schema.pan b/ncm-maui/src/main/pan/components/maui/schema.pan deleted file mode 100644 index 95600082..00000000 --- a/ncm-maui/src/main/pan/components/maui/schema.pan +++ /dev/null @@ -1,14 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} - -declaration template components/maui/schema; - -include 'quattor/types/component'; - -type ${project.artifactId}_component = { - include structure_component - 'configPath' ? string - 'configFile' ? string - 'contents' ? string -}; diff --git a/ncm-maui/src/main/perl/maui.pm b/ncm-maui/src/main/perl/maui.pm deleted file mode 100755 index ca16a0db..00000000 --- a/ncm-maui/src/main/perl/maui.pm +++ /dev/null @@ -1,70 +0,0 @@ -#${PMpre} NCM::Component::maui${PMpost} - -use parent qw(NCM::Component CAF::Path); -our $EC = LC::Exception::Context->new->will_store_all; - -our $NoActionSupported = 1; - -use Readonly; - -Readonly my $MAUI_SYSVINIT => '/etc/init.d/maui'; -Readonly my $MAUI_SYSTEMD => '/usr/lib/systemd/system/maui.service'; - -use CAF::FileWriter; -use CAF::Service; - -sub Configure -{ - - my ($self, $config) = @_; - - my $tree = $config->getTree($self->prefix()); - - my $mauipath = $tree->{configPath} || "/var/spool/maui"; - - my $mauifile = $tree->{configFile} || "maui.cfg"; - - # Ensure that the directory exists. - if (! $self->directory($mauipath)) { - $self->error("Can't create directory $mauipath: $self->{fail}"); - return 1; - } - - # Retrieve the contents of the file. - if (! $tree->{contents}) { - $self->error("configuration contents not specified"); - return 1; - } - - my $fname = "$mauipath/$mauifile"; - - my $fh = CAF::FileWriter->new($fname, backup => '.old', log => $self); - - print $fh "#\n# File generated by ncm-maui\n#\n"; - print $fh $tree->{contents}; - - if ($fh->close()) { - $self->info("$fname updated"); - - if ( $self->file_exists($MAUI_SYSTEMD) || $self->file_exists($MAUI_SYSVINIT) ) { - # Restart the daemon. - # The restart method doesn't work so manually do a stop and start. - my $srv = CAF::Service->new(['maui'], log => $self); - - if ($srv->stop_sleep_start(5)) { - $self->info("Maui stopped/started"); - } else { - $self->error("maui stop/start failed: $?"); - } - } else { - $self->info("$MAUI_SYSVINIT or $MAUI_SYSTEMD do not exist, assuming configuration of maui client"); - } - } else { - $self->verbose("$fname unchanged"); - } - - - return 1; -} - -1; diff --git a/ncm-maui/src/main/perl/maui.pod b/ncm-maui/src/main/perl/maui.pod deleted file mode 100755 index 3558a547..00000000 --- a/ncm-maui/src/main/perl/maui.pod +++ /dev/null @@ -1,33 +0,0 @@ -# ${license-info} -# ${developer-info} -# ${author-info} -# ${build-info} -# - -=head1 NAME - -maui: NCM component to configure Maui server. - -=head1 DESCRIPTION - -The I component manages the configuration for the maui -scheduler. By default the configuration file resides in -/var/spool/maui/maui.cfg. - -=head1 RESOURCES - -=head2 configPath (/var/spool/maui) - -The absolute path for the maui configuration directory. - -=head2 configFile (maui.cfg) - -The file name for the maui configuration file. - -=head3 contents - -The full contents of the maui configuration file. The syntax is too -complex to fully translate into pan. You must supply the complete -maui configuration file in this variable. - -=cut diff --git a/ncm-maui/src/test/perl/00-load.t b/ncm-maui/src/test/perl/00-load.t deleted file mode 100644 index 9dcf4a79..00000000 --- a/ncm-maui/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::maui"); diff --git a/ncm-maui/src/test/perl/pod-syntax.t b/ncm-maui/src/test/perl/pod-syntax.t deleted file mode 100644 index a7864338..00000000 --- a/ncm-maui/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-maui/src/test/perl/simple.t b/ncm-maui/src/test/perl/simple.t deleted file mode 100644 index 70e61078..00000000 --- a/ncm-maui/src/test/perl/simple.t +++ /dev/null @@ -1,35 +0,0 @@ -use strict; -use warnings; - -BEGIN { - *CORE::GLOBAL::sleep = sub {}; -} - - -use Test::More; -use CAF::Object; -use Test::Quattor qw(simple); -use NCM::Component::maui; - -my $cfg = get_config_for_profile('simple'); -my $cmp = NCM::Component::maui->new('simple'); - -set_file_contents("/var/spool/maui/maui.cfg", "something"); - -# fake sysvinit file, should be enough to bypass existence check -set_file_contents("/etc/init.d/maui", "something"); - - -command_history_reset(); - -is($cmp->Configure($cfg), 1, "Component runs correctly with a test profile"); - -my $fh = get_file("/var/spool/maui/maui.cfg"); -is("$fh", "#\n# File generated by ncm-maui\n#\nsomething new\n", "File content updated"); - -ok(command_history_ok([ - 'service maui stop', - 'service maui start', -]), "expected commands for change"); - -done_testing; diff --git a/ncm-maui/src/test/resources/ccm.cfg b/ncm-maui/src/test/resources/ccm.cfg deleted file mode 100644 index d0aebda3..00000000 --- a/ncm-maui/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/ncm-maui/src/test/resources/simple.pan b/ncm-maui/src/test/resources/simple.pan deleted file mode 100644 index 6804a046..00000000 --- a/ncm-maui/src/test/resources/simple.pan +++ /dev/null @@ -1,11 +0,0 @@ -object template simple; - -# mock pkg_repl -function pkg_repl = { null; }; - -include 'components/maui/config'; - -# remove the dependencies -'/software/components/maui/dependencies' = null; - -"/software/components/maui/contents" = "something new\n"; diff --git a/pom.xml b/pom.xml index 95e511cc..79707b03 100644 --- a/pom.xml +++ b/pom.xml @@ -38,7 +38,6 @@ ncm-lcgbdii ncm-lcgmonjob ncm-lcmaps - ncm-maui ncm-mkgridmap ncm-myproxy ncm-pbsclient