-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from RockefellerArchiveCenter/deliver
Delivers transfers to microservice environment
- Loading branch information
Showing
28 changed files
with
317 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,15 +62,4 @@ EMAIL_USE_SSL = False | |
EMAIL_OVERRIDE = True | ||
EMAIL_OVERRIDE_USERS = ['[email protected]'] | ||
|
||
# Microservice integrations | ||
DELIVERY = { | ||
'user': 'root', | ||
'host': 'http://ursa_major', | ||
'dir': '/storage/' | ||
} | ||
CALLBACKS = [ | ||
{ | ||
'method': 'POST', | ||
'uri': 'http://ursa_major/' | ||
} | ||
] | ||
DELIVERY_URL = 'http://zodiac-web:8001/api/store-accessions/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
from os.path import join, isfile | ||
from os import remove | ||
|
||
from aurora import settings | ||
|
||
|
||
class CleanupError(Exception): pass | ||
|
||
|
||
class CleanupRoutine: | ||
def __init__(self, identifier): | ||
self.identifier = identifier | ||
self.dir = settings.DELIVERY_QUEUE_DIR | ||
|
||
def run(self): | ||
try: | ||
self.filepath = "{}.tar.gz".format(join(self.dir, self.identifier)) | ||
if isfile(self.filepath): | ||
remove(self.filepath) | ||
return "Transfer {} removed.".format(self.identifier) | ||
return "Transfer {} was not found.".format(self.identifier) | ||
except Exception as e: | ||
raise CleanupError(e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.15 on 2018-11-20 14:02 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('bag_transfer', '0015_auto_20181025_1342'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='archives', | ||
name='archivesspace_identifier', | ||
field=models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
migrations.AddField( | ||
model_name='archives', | ||
name='archivesspace_parent_identifier', | ||
field=models.CharField(blank=True, max_length=255, null=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.