mirror of
https://github.com/google/nomulus.git
synced 2025-05-13 07:57:13 +02:00
Make driveFolderId on Registry entity optional
This defaults to null, and leaving it to null now simply disables reserved terms exporting, rather than throwing an error every time the action runs. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=138763161
This commit is contained in:
parent
9122372e38
commit
274b070b54
3 changed files with 14 additions and 11 deletions
|
@ -14,7 +14,6 @@
|
|||
|
||||
package google.registry.export;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
import static com.google.common.base.Strings.isNullOrEmpty;
|
||||
import static com.google.common.net.MediaType.PLAIN_TEXT_UTF_8;
|
||||
import static google.registry.export.ExportUtils.exportReservedTerms;
|
||||
|
@ -62,8 +61,11 @@ public class ExportReservedTermsAction implements Runnable {
|
|||
if (registry.getReservedLists().isEmpty() && isNullOrEmpty(registry.getDriveFolderId())) {
|
||||
resultMsg = "No reserved lists configured";
|
||||
logger.infofmt("No reserved terms to export for TLD %s", tld);
|
||||
} else if (registry.getDriveFolderId() == null) {
|
||||
resultMsg = "Skipping export because no Drive folder is associated with this TLD";
|
||||
logger.infofmt(
|
||||
"Skipping reserved terms export for TLD %s because Drive folder isn't specified", tld);
|
||||
} else {
|
||||
checkNotNull(registry.getDriveFolderId(), "No drive folder associated with this TLD");
|
||||
resultMsg = driveConnection.createOrUpdateFile(
|
||||
RESERVED_TERMS_FILENAME,
|
||||
EXPORT_MIME_TYPE,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue