Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(88)

Issue 51520043: Create a backup copy of the envs file.

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by frankban
Modified:
10 years, 3 months ago
Reviewers:
mp+201449
Visibility:
Public.

Description

Create a backup copy of the envs file. In a pre-imp call with Gary, we decided the following strategy: a backup copy of the environments.yaml file is created once per quickstart session the first time environments are changed by the user. This way we prevent the original backup to be overwritten if the user makes two subsequent changes to the envs. Tests: `make check`. QA: - Create a backup copy of your environments file: `cp ~/.juju/environments.yaml ~/environments.yaml.bak`. - Run `.venv/bin/python juju-quickstart -i`, select one of your environments, exit with ^X without changing anything. Check your original file has not been changed. - Run `.venv/bin/python juju-quickstart -i`, change something (e.g. create, remove or change an environment, or just change the default one). Change at least two environments. Exit with ^X. The envs.yaml file now should be the one generated by quickstart and should reflect your changes. It also includes the path to the backup copy, which should be your original file. - Restore your original environments file: `mv ~/environments.yaml.bak ~/.juju/environments.yaml`. Done, thank you! https://code.launchpad.net/~frankban/juju-quickstart/envs-backup/+merge/201449 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : Create a backup copy of the envs file. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -9 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M quickstart/manage.py View 2 chunks +4 lines, -1 line 0 comments Download
M quickstart/models/envs.py View 1 chunk +18 lines, -4 lines 0 comments Download
M quickstart/tests/models/test_envs.py View 3 chunks +45 lines, -0 lines 0 comments Download
M quickstart/tests/test_manage.py View 2 chunks +13 lines, -4 lines 0 comments Download
M quickstart/tests/test_utils.py View 1 1 chunk +19 lines, -0 lines 0 comments Download
M quickstart/utils.py View 2 chunks +15 lines, -0 lines 0 comments Download

Messages

Total messages: 3
frankban
Please take a look.
10 years, 3 months ago (2014-01-13 16:11:44 UTC) #1
frankban
Matthew approved this MP, but he's not currently able to log in to Rietveld. Thanks ...
10 years, 3 months ago (2014-01-14 09:20:43 UTC) #2
frankban
10 years, 3 months ago (2014-01-14 09:22:25 UTC) #3
*** Submitted:

Create a backup copy of the envs file.

In a pre-imp call with Gary, we decided the
following strategy: a backup copy of the
environments.yaml file is created once per
quickstart session the first time environments
are changed by the user. This way we prevent the
original backup to be overwritten if the user
makes two subsequent changes to the envs.

Tests: `make check`.

QA:

- Create a backup copy of your environments file:
  `cp ~/.juju/environments.yaml ~/environments.yaml.bak`.

- Run `.venv/bin/python juju-quickstart -i`, select one
  of your environments, exit with ^X without changing anything.
  Check your original file has not been changed.

- Run `.venv/bin/python juju-quickstart -i`, change something
  (e.g. create, remove or change an environment, or just change
  the default one). Change at least two environments.
  Exit with ^X. The envs.yaml file now should be the one
  generated by quickstart and should reflect your changes.
  It also includes the path to the backup copy, which
  should be your original file.

- Restore your original environments file:
  `mv ~/environments.yaml.bak ~/.juju/environments.yaml`.

Done, thank you!

R=
CC=
https://codereview.appspot.com/51520043
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b