Skip to content

Commit

Permalink
bootloader: Don't fail on missing cell name
Browse files Browse the repository at this point in the history
If a pool name isn't defined in the configuration, the dCache fails due
to failure to parse the shell oracle.

This patch addresses this problem. check-config doesn't report the error
as there is nothing in the definition of a service that requires it
to start a cell and thus we cannot complain about lack of a cell name.
The pool will however report the lack of a name during startup.

Target: trunk
Require-notes: yes
Require-book: no
Request: 2.11
Request: 2.10
Acked-by: Paul Millar <paul.millar@desy.de>
Patch: https://rb.dcache.org/r/7641/
  • Loading branch information
gbehrmann committed Jan 14, 2015
1 parent d8182a5 commit da7ba82
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion modules/dcache/src/main/java/org/dcache/boot/Domain.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import ch.qos.logback.classic.joran.JoranConfigurator;
import ch.qos.logback.core.joran.spi.JoranException;
import ch.qos.logback.core.util.StatusPrinter;
import com.google.common.base.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.FileSystemResource;
Expand Down Expand Up @@ -64,7 +65,7 @@ public List<String> getCellNames()
List<String> cells = new ArrayList<>();
for (ConfigurationProperties service: _services) {
String cellName = Properties.getCellName(service);
if (cellName != null) {
if (!Strings.isNullOrEmpty(cellName)) {
cells.add(cellName);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.dcache.boot;

import com.google.common.base.Strings;

import java.io.PrintStream;

import org.dcache.util.ConfigurationProperties;
Expand Down Expand Up @@ -155,7 +157,7 @@ private void printDomainServices(IndentPrinter out, Domain domain)

for(ConfigurationProperties service : domain.getServices()) {
String name = Properties.getCellName(service);
if(name != null) {
if (!Strings.isNullOrEmpty(name)) {
out.println("'" + markup(name) + "' : {");
printProperties(indent, service, domain.properties());
indent.println("},");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.dcache.boot;

import com.google.common.base.Strings;

import java.io.PrintStream;

import org.dcache.util.ConfigurationProperties;
Expand Down Expand Up @@ -41,7 +43,7 @@ public void print(PrintStream out) {
out.println(" ;;"); // Fall through
for (ConfigurationProperties service: domain.getServices()) {
String cellName = Properties.getCellName(service);
if (cellName != null) {
if (!Strings.isNullOrEmpty(cellName)) {
out.append(" ").append(quoteForCase(cellName)).println(")");
compile(out, " ", service, domain.properties());
out.println(" ;;");
Expand Down

0 comments on commit da7ba82

Please sign in to comment.