Renames a snapshot
(old_name, new_name)
| 149 | @click.argument('old_name') |
| 150 | @click.argument('new_name') |
| 151 | def rename(old_name, new_name): |
| 152 | """Renames a snapshot""" |
| 153 | app = get_app() |
| 154 | |
| 155 | snapshot = app.get_snapshot(old_name) |
| 156 | if not snapshot: |
| 157 | click.echo("Couldn't find snapshot %s" % old_name) |
| 158 | sys.exit(1) |
| 159 | |
| 160 | new_snapshot = app.get_snapshot(new_name) |
| 161 | if new_snapshot: |
| 162 | click.echo("Snapshot with name %s already exists" % new_name) |
| 163 | sys.exit(1) |
| 164 | |
| 165 | app.rename_snapshot(snapshot, new_name) |
| 166 | click.echo("Renamed snapshot %s to %s" % (old_name, new_name)) |
| 167 | |
| 168 | |
| 169 | @stellar.command() |
nothing calls this directly
no test coverage detected