|
7 | 7 | from ..rpc import get_default_datadir, RPC_PORTS |
8 | 8 | from ..specter_error import SpecterError, SpecterInternalException |
9 | 9 | from ..persistence import PersistentObject, write_node, delete_file |
10 | | -from ..helpers import alias, calc_fullpath, load_jsons |
| 10 | +from ..helpers import create_unique_id, calc_fullpath, load_jsons |
11 | 11 | from ..node import Node, NonExistingNode |
12 | 12 | from ..internal_node import InternalNode |
13 | 13 | from ..services import callbacks |
@@ -193,11 +193,11 @@ def add_external_node( |
193 | 193 | This should only be used for an external node. Use add_internal_node for internal node |
194 | 194 | and if you have defined your own node type, use save_node directly to save the node (and create it yourself) |
195 | 195 | """ |
196 | | - node_alias = alias(name) |
| 196 | + node_alias = create_unique_id(name) |
197 | 197 | fullpath = os.path.join(self.data_folder, "%s.json" % node_alias) |
198 | 198 | i = 2 |
199 | 199 | while os.path.isfile(fullpath): |
200 | | - node_alias = alias("%s %d" % (name, i)) |
| 200 | + node_alias = create_unique_id("%s %d" % (name, i)) |
201 | 201 | fullpath = os.path.join(self.data_folder, "%s.json" % node_alias) |
202 | 202 | i += 1 |
203 | 203 |
|
@@ -239,11 +239,11 @@ def add_internal_node( |
239 | 239 | This should only be used for internal nodes. Use add__External_node for external nodes |
240 | 240 | and if you have defined your own node-type, use save_node directly. to save the node (and create it yourself) |
241 | 241 | """ |
242 | | - node_alias = alias(name) |
| 242 | + node_alias = create_unique_id(name) |
243 | 243 | fullpath = os.path.join(self.data_folder, "%s.json" % node_alias) |
244 | 244 | i = 2 |
245 | 245 | while os.path.isfile(fullpath): |
246 | | - node_alias = alias("%s %d" % (name, i)) |
| 246 | + node_alias = create_unique_id("%s %d" % (name, i)) |
247 | 247 | fullpath = os.path.join(self.data_folder, "%s.json" % node_alias) |
248 | 248 | i += 1 |
249 | 249 | if not datadir: |
|
0 commit comments