-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Exporter models based on pulpcore changes
ref #6328 https://pulp.plan.io/issues/6328 Required PR: pulp/pulpcore#585
- Loading branch information
David Davis
committed
Mar 24, 2020
1 parent
b0a4b43
commit 61e8ed0
Showing
10 changed files
with
94 additions
and
52 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Added history for filesystem exports at ``/exporters/file/filesystem/<uuid>/exports/``. |
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,5 @@ | ||
The fileystem exporter endpoint has been moved from ``/exporters/file/file/`` to | ||
``/exporters/file/filesystem/`` and the export endpoint is now at POST | ||
``/exporters/file/filesystem/<uuid>/exports/``. Additionally, the table is being dropped and | ||
recreated due to a data structure change in core so users will lose any filesystem exporter data on | ||
upgrade. |
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,16 @@ | ||
#!/usr/bin/env bash | ||
export EXPORTER_NAME=$(head /dev/urandom | tr -dc a-z | head -c5) | ||
export DEST_DIR="/data" | ||
|
||
echo "Created a new file system exporter $EXPORTER_NAME." | ||
export EXPORTER_HREF=$(http POST $BASE_ADDR/pulp/api/v3/exporters/file/filesystem/ \ | ||
name=$EXPORTER_NAME path=$DEST_DIR | jq -r '.pulp_href') | ||
|
||
export TASK_URL=$(http POST $BASE_ADDR$EXPORTER_HREF'exports/' publication=$PUBLICATION_HREF | ||
| jq -r '.task') | ||
|
||
# Poll the task (here we use a function defined in docs/_scripts/base.sh) | ||
wait_until_task_finished $BASE_ADDR$TASK_URL | ||
|
||
echo "Inspecting export at $DEST_DIR" | ||
ls $DEST_DIR |
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
16 changes: 16 additions & 0 deletions
16
pulp_file/app/migrations/0006_delete_filefilesystemexporter.py
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,16 @@ | ||
# Generated by Django 2.2.6 on 2020-03-13 16:18 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('file', '0005_filerepository'), | ||
] | ||
|
||
operations = [ | ||
migrations.DeleteModel( | ||
name='FileFileSystemExporter', | ||
), | ||
] |
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,26 @@ | ||
# Generated by Django 2.2.6 on 2020-03-17 13:07 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('core', '0023_change_exporter_models'), | ||
('file', '0006_delete_filefilesystemexporter'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='FileFileSystemExporter', | ||
fields=[ | ||
('exporter_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='file_filefilesystemexporter', serialize=False, to='core.Exporter')), | ||
('path', models.TextField()), | ||
], | ||
options={ | ||
'default_related_name': '%(app_label)s_%(model_name)s', | ||
}, | ||
bases=('core.exporter',), | ||
), | ||
] |
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 |
---|---|---|
@@ -1,3 +1,2 @@ | ||
from .exporting import file_export # noqa | ||
from .publishing import publish # noqa | ||
from .synchronizing import synchronize # noqa |
This file was deleted.
Oops, something went wrong.
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