Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DB Import/Export Service Name #73

Merged
merged 5 commits into from
May 9, 2024
Merged

Fix DB Import/Export Service Name #73

merged 5 commits into from
May 9, 2024

Conversation

jdrew82
Copy link
Contributor

@jdrew82 jdrew82 commented May 8, 2024

This PR addresses the issue mentioned in #72 that is related to the use of postgres for the service name when it was changed to db. This also removed the deprecated version lines from the compose files.

@jdrew82 jdrew82 self-assigned this May 8, 2024
@jdrew82 jdrew82 requested a review from jvanderaa as a code owner May 8, 2024 18:54
@jdrew82 jdrew82 added the bug Something isn't working label May 8, 2024
tasks.py Outdated
sleep(2) # Wait for the database to be ready

print("Exporting the database as an SQL dump...")
export_cmd = 'exec postgres sh -c "pg_dump -h localhost -d \${NAUTOBOT_DB_NAME} -U \${NAUTOBOT_DB_USER} > /tmp/nautobot.sql"' # noqa: W605 pylint: disable=anomalous-backslash-in-string
export_cmd = 'exec db sh -c "pg_dump -h localhost -d \${NAUTOBOT_DB_NAME} -U \${NAUTOBOT_DB_USER} > /tmp/nautobot.sql"' # noqa: W605 pylint: disable=anomalous-backslash-in-string
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if they are using mysql? I'm assuming it should be a different command than pg_dump.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I figured out how to do that and have pushed an update to cover that case.

Copy link

@joewesch joewesch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@jvanderaa jvanderaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jvanderaa jvanderaa merged commit 553a546 into main May 9, 2024
2 checks passed
@jdrew82 jdrew82 deleted the patch-fix_72 branch May 9, 2024 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error in invoke db-export due to incorrect service name and obsolete version warnings
3 participants