Fixes the share reading of NetOrk/netork#3104, on napalm-device-types 4.58.0 and napalm-linux 0.27.0.
What was broken:get_shares() found no share at all on a real OMV 8.8 host. It asked for data models OMV does not have (conf.service.nfs.shares; the models are conf.service.*.share), without root although config.xml is 0660 root:openmediavault-config, without the full path although /usr/sbin is not on a login user's PATH, and stored every failure as a NAS without shares. It would also have dropped every Samba share (no name field; the share is its shared folder's name) and let several NFS clients of one folder overwrite each other.
Now (_shares.OmvSharesMixin):
every model in one sudo round trip; a plugin that is not installed has no model and no shares; a model that fails, a report cut short or sudo refusing raises;
Samba, NFS (one share per folder, one access rule per client with options and comment), FTP, rsync modules, the TFTP plugin's root and Samba's homes;
each share names its service (smbd, nfs-server, proftpd, rsync, tftpd-hpa) and its export (/export/<folder> over NFS); enabled only while OMV has the service on; volume is the file system.
Checked against the real host: 11 Samba, 3 NFS, 1 FTP and 1 TFTP share. Version 0.4.0; tag v0.4.0 after the merge.
Fixes the share reading of NetOrk/netork#3104, on napalm-device-types 4.58.0 and napalm-linux 0.27.0.
**What was broken:** `get_shares()` found no share at all on a real OMV 8.8 host. It asked for data models OMV does not have (`conf.service.nfs.shares`; the models are `conf.service.*.share`), without root although `config.xml` is `0660 root:openmediavault-config`, without the full path although `/usr/sbin` is not on a login user's `PATH`, and stored every failure as a NAS without shares. It would also have dropped every Samba share (no name field; the share is its shared folder's name) and let several NFS clients of one folder overwrite each other.
**Now** (`_shares.OmvSharesMixin`):
- every model in one sudo round trip; a plugin that is not installed has no model and no shares; a model that fails, a report cut short or sudo refusing raises;
- Samba, NFS (one share per folder, one access rule per client with options and comment), FTP, rsync modules, the TFTP plugin's root and Samba's `homes`;
- each share names its service (`smbd`, `nfs-server`, `proftpd`, `rsync`, `tftpd-hpa`) and its `export` (`/export/<folder>` over NFS); enabled only while OMV has the service on; `volume` is the file system.
Checked against the real host: 11 Samba, 3 NFS, 1 FTP and 1 TFTP share. Version 0.4.0; tag `v0.4.0` after the merge.
get_shares() found no share at all: it asked for data models OMV does not have
(conf.service.nfs.shares and its siblings), without root although config.xml is
root's, without the full path although /usr/sbin is not on a login user's PATH,
and stored every failure as a NAS without shares. Samba shares were dropped for
want of a name of their own, and several NFS clients of one folder overwrote
each other.
Now every model is read through sudo in one round trip; a share takes its shared
folder's name; NFS is one share per folder with one access rule per client; each
share names its service (smbd, nfs-server, proftpd, rsync, tftpd-hpa) and what a
client names (/export/<folder> over NFS); rsync modules, the TFTP root and Samba's
homes are shares too; a read that fails raises.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes the share reading of NetOrk/netork#3104, on napalm-device-types 4.58.0 and napalm-linux 0.27.0.
What was broken:
get_shares()found no share at all on a real OMV 8.8 host. It asked for data models OMV does not have (conf.service.nfs.shares; the models areconf.service.*.share), without root althoughconfig.xmlis0660 root:openmediavault-config, without the full path although/usr/sbinis not on a login user'sPATH, and stored every failure as a NAS without shares. It would also have dropped every Samba share (no name field; the share is its shared folder's name) and let several NFS clients of one folder overwrite each other.Now (
_shares.OmvSharesMixin):homes;smbd,nfs-server,proftpd,rsync,tftpd-hpa) and itsexport(/export/<folder>over NFS); enabled only while OMV has the service on;volumeis the file system.Checked against the real host: 11 Samba, 3 NFS, 1 FTP and 1 TFTP share. Version 0.4.0; tag
v0.4.0after the merge.