mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
chore: Refactor machine name sanitization method
This commit is contained in:
parent
029224c749
commit
397523c9a3
@ -311,8 +311,8 @@ class DynamicPublication(services.Publication, autoserializable.AutoSerializable
|
||||
|
||||
# First we should create a full clone, so base machine do not get fullfilled with "garbage" delta disks...
|
||||
# Add a number based on current time to avoid collisions
|
||||
self._name = self.service().sanitize_machine_name(
|
||||
f'UDS-Pub {self.servicepool_name()}-{int(time.time())%256:2X} {self.revision()}'
|
||||
self._name = self.service().sanitized_name(
|
||||
f'UDS-Pub-{self.servicepool_name()}-{int(time.time())%256:2X}-{self.revision()}'
|
||||
)
|
||||
self._is_flagged_for_destroy = False
|
||||
|
||||
|
@ -109,7 +109,7 @@ class DynamicService(services.Service, abc.ABC): # pylint: disable=too-many-pub
|
||||
def get_lenname(self) -> int:
|
||||
return self.lenname.value
|
||||
|
||||
def sanitize_machine_name(self, name: str) -> str:
|
||||
def sanitized_name(self, name: str) -> str:
|
||||
"""
|
||||
Sanitize machine name
|
||||
Override it to provide a custom name sanitizer
|
||||
|
Loading…
Reference in New Issue
Block a user