diff options
-rw-r--r-- | lbup/targets.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lbup/targets.py b/lbup/targets.py index cc7b027..179eeb7 100644 --- a/lbup/targets.py +++ b/lbup/targets.py @@ -271,8 +271,8 @@ class TargetSSHLVM(TargetSSH): '--noheadings -o lv_full_name'.format(major = major, minor = minor)) lv_name = res.strip() - # valid LV paths are volname/lvname, each at most 15 letters - if not re.fullmatch(r'\w{1,15}/\w{1,15}', lv_name, re.ASCII): + # valid LV paths are volname/lvname, each non-empty alphanumeric+_ + if not re.fullmatch(r'\w+/\w+', lv_name, re.ASCII): raise BackupException('Invalid LV path', lv_name) return lv_name @@ -289,8 +289,7 @@ class TargetSSHLVM(TargetSSH): vg_name = lv_fullname.split('/')[0] # create a read-only snapshot with a random name - # valid LV names are at most 15 characters - snapshot_name = secrets.token_urlsafe()[:15] + snapshot_name = secrets.token_urlsafe() snapshot_fullname = '%s/%s' % (vg_name, snapshot_name) self._paramiko_exec_cmd(ssh, 'lvcreate --permission r --snapshot -L {size} -n {name} {origin}' @@ -467,7 +466,7 @@ class TargetSSHLXCLVM(TargetSSH): raise BackupException('Unexpected LV/VG name: %s\t%s' % (lv_name, vg_name)) # create a read-only snapshot with a random name - snapshot_name = secrets.token_urlsafe()[:15] + snapshot_name = secrets.token_urlsafe() self._paramiko_exec_cmd(parent, 'lvcreate --permission r --snapshot -L {size} -n {name} {origin}' .format(size = self._snapshot_size, name = snapshot_name, |