node_deployer.utils
Singleton
Bases: type
A singleton metaclass
Source code in src/node_deployer/utils.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
__call__(*args, **kwargs)
Creates a new instance of the class if one does not already exist
Returns:
| Type | Description |
|---|---|
|
cls._instance: The instance of the class |
Source code in src/node_deployer/utils.py
32 33 34 35 36 37 38 39 40 | |
ensure_build_dir(f)
Ensures that the build directory exists before running the decorated function
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f |
Callable
|
The function to decorate |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Callable |
Callable
|
The decorated function |
Source code in src/node_deployer/utils.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
next_free_tcp_port(port)
Finds the next free port after the specified port
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port |
int
|
The port to start searching from |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no free ports are found |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
The next free port |
Source code in src/node_deployer/utils.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |
Last update:
November 7, 2023
Created: November 7, 2023
Created: November 7, 2023