Skip to content

Commit

Permalink
fixed description bug
Browse files Browse the repository at this point in the history
  • Loading branch information
XaverStiensmeier committed Nov 30, 2024
1 parent 62aca95 commit bfb5e45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 5 additions & 2 deletions bibigrid/core/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,15 @@ def list_servers(self):
"""

@abstractmethod
def create_server(self, name, flavor, image, network, key_name=None, wait=True, volumes=None, security_groups=None,
def create_server(self, *, name, flavor, image, network, key_name=None, wait=True, volumes=None,
security_groups=None,
boot_volume=None, boot_from_volume=False,
terminate_boot_volume=False, volume_size=50): # pylint: disable=too-many-arguments
terminate_boot_volume=False, volume_size=50,
description=""): # pylint: disable=too-many-arguments
"""
Creates a new server and waits for it to be accessible if wait=True. If volumes are given, they are attached.
Returns said server (dict)
@param description: server description; ignored by some providers
@param volume_size: Size of boot volume if set. Defaults to 50.
@param terminate_boot_volume: if True, boot volume gets terminated on server termination
@param boot_from_volume: if True, a boot volume is created from the image
Expand Down
8 changes: 5 additions & 3 deletions bibigrid/openstack/openstack_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,11 @@ def get_subnet_by_id_or_name(self, subnet_id_or_name):
def list_servers(self):
return [elem.toDict() for elem in self.conn.list_servers()]

def create_server(self, name, flavor, image, network, key_name=None, wait=True, volumes=None, security_groups=None,
# pylint: disable=too-many-positional-arguments
boot_volume=None, boot_from_volume=False, terminate_boot_volume=False, volume_size=50):
def create_server(self, *, name, flavor, image, network, key_name=None, wait=True, volumes=None,
security_groups=None,
# pylint: disable=too-many-positional-arguments,too-many-locals
boot_volume=None, boot_from_volume=False, terminate_boot_volume=False, volume_size=50,
description=""):
try:
server = self.conn.create_server(name=name, flavor=flavor, image=image, network=network, key_name=key_name,
volumes=volumes, security_groups=security_groups, boot_volume=boot_volume,
Expand Down

0 comments on commit bfb5e45

Please sign in to comment.