2 def __init__(self
, name
, id=None, flavor
=None, image
=None, command
=None, nw_list
=None):
5 self
.template_name
= None
9 self
.port_names
= list()
10 self
.properties
= dict()
12 self
.son_emu_command
= None
13 self
.emulator_compute
= None
15 def compare_attributes(self
, other
):
17 Compares only class attributes like name and flavor but not the list of ports with the other server.
19 :param other: The second server to compare with.
20 :type other: :class:`heat.resources.server`
21 :return: * *True*: If all attributes are alike.
25 if self
.name
== other
.name
and self
.full_name
== other
.full_name
and \
26 self
.flavor
== other
.flavor
and \
27 self
.image
== other
.image
and \
28 self
.command
== other
.command
:
32 def __eq__(self
, other
):
33 if self
.name
== other
.name
and self
.full_name
== other
.full_name
and \
34 self
.flavor
== other
.flavor
and \
35 self
.image
== other
.image
and \
36 self
.command
== other
.command
and \
37 len(self
.port_names
) == len(other
.port_names
) and \
38 set(self
.port_names
) == set(other
.port_names
):
42 def create_server_dict(self
, compute
=None):
44 Creates the server description dictionary.
46 :param compute: The compute resource for further status information.
47 :type compute: :class:`heat.compute`
48 :return: Server description dictionary.
52 server_dict
['name'] = self
.name
53 server_dict
['full_name'] = self
.full_name
54 server_dict
['id'] = self
.id
55 server_dict
['template_name'] = self
.template_name
56 server_dict
['flavor'] = self
.flavor
57 server_dict
['image'] = self
.image
58 if self
.son_emu_command
is not None:
59 server_dict
['command'] = self
.son_emu_command
61 server_dict
['command'] = self
.command
63 if compute
is not None:
64 server_dict
['status'] = 'ACTIVE'
65 server_dict
['OS-EXT-STS:power_state'] = 1
66 server_dict
["OS-EXT-STS:task_state"] = None