def create(gandi, name, datacenter, subnet, gateway, background):
    """ Create a new vlan """
    try:
        gandi.datacenter.is_opened(datacenter, 'iaas')
    except DatacenterLimited as exc:
        gandi.echo('/!\ Datacenter %s will be closed on %s, '
                   'please consider using another datacenter.' %
                   (datacenter, exc.date))

    result = gandi.vlan.create(name, datacenter, subnet, gateway, background)

    if background:
        gandi.pretty_echo(result)

    return result
def create ( gandi , name , datacenter , subnet , gateway , background ) : try : gandi . datacenter . is_opened ( datacenter , 'iaas' ) except DatacenterLimited as exc : gandi . echo ( '/!\ Datacenter %s will be closed on %s, ' 'please consider using another datacenter.' % ( datacenter , exc . date ) ) result = gandi . vlan . create ( name , datacenter , subnet , gateway , background ) if background : gandi . pretty_echo ( result ) return result
Create a new vlan