Revision a6e6fe48 snf-cyclades-app/synnefo/logic/management/commands/floating-ip-attach.py
b/snf-cyclades-app/synnefo/logic/management/commands/floating-ip-attach.py | ||
---|---|---|
1 |
# Copyright 2012 GRNET S.A. All rights reserved. |
|
1 |
# Copyright 2012-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 |
... | ... | |
61 | 61 |
raise CommandError('Please give either a server or a router id') |
62 | 62 |
|
63 | 63 |
#get the vm |
64 |
vm = common.get_vm(device, for_update=True)
|
|
65 |
floating_ip = common.get_floating_ip_by_id(floating_ip_id,
|
|
66 |
for_update=True)
|
|
64 |
vm = common.get_resource("server", device, for_update=True)
|
|
65 |
floating_ip = common.get_resource("floating-ip", floating_ip_id,
|
|
66 |
for_update=True) |
|
67 | 67 |
servers.create_port(vm.userid, floating_ip.network, |
68 | 68 |
use_ipaddress=floating_ip, machine=vm) |
69 | 69 |
|
Also available in: Unified diff