File: __init__.py

package info (click to toggle)
python-softlayer 6.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,508 kB
  • sloc: python: 57,195; makefile: 133; xml: 97; sh: 59
file content (18 lines) | stat: -rw-r--r-- 487 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Firewalls."""
# :license: MIT, see LICENSE for more details.

from SoftLayer.CLI import exceptions


def parse_id(input_id):
    """Helper package to retrieve the actual IDs.

    :param input_id: the ID provided by the user
    :returns: A list of valid IDs
    """
    key_value = input_id.split(':')

    if len(key_value) != 2:
        raise exceptions.CLIAbort(
            'Invalid ID %s: ID should be of the form xxx:yyy' % input_id)
    return key_value[0], int(key_value[1])