Revision a6e6fe48 snf-cyclades-app/synnefo/logic/management/commands/server-modify.py

b/snf-cyclades-app/synnefo/logic/management/commands/server-modify.py
1
# Copyright 2013 GRNET S.A. All rights reserved.
1
# Copyright 2013-2014 GRNET S.A. All rights reserved.
2 2
#
3 3
# Redistribution and use in source and binary forms, with or
4 4
# without modification, are permitted provided that the following
......
35 35

  
36 36
from django.db import transaction
37 37
from django.core.management.base import BaseCommand, CommandError
38
from synnefo.management.common import (get_vm, get_flavor, convert_api_faults,
38
from synnefo.management.common import (get_resource, convert_api_faults,
39 39
                                       wait_server_task)
40 40
from snf_django.management.utils import parse_bool
41 41
from synnefo.logic import servers
......
93 93
        if len(args) != 1:
94 94
            raise CommandError("Please provide a server ID")
95 95

  
96
        server = get_vm(args[0], for_update=True)
96
        server = get_resource("server", args[0], for_update=True)
97 97

  
98 98
        new_name = options.get("name", None)
99 99
        if new_name is not None:
......
123 123
        wait = parse_bool(options["wait"])
124 124
        new_flavor_id = options.get("flavor")
125 125
        if new_flavor_id is not None:
126
            new_flavor = get_flavor(new_flavor_id)
126
            new_flavor = get_resource("flavor", new_flavor_id)
127 127
            old_flavor = server.flavor
128 128
            msg = "Resizing server '%s' from flavor '%s' to '%s'.\n"
129 129
            self.stdout.write(msg % (server, old_flavor, new_flavor))

Also available in: Unified diff