Thanks for taking the time to file a bug and making Ubuntu server better! ^.^
In my opinion, I'd expect those two directories to be there, if they're not, then there's something wrong, really. Either a user manipulation or whatever. Maybe instead of the hook failing, it could gracefully exit, mentioning that both the directories aren't present which is somewhat unusual.
The code comes from debian/additions/source_mysql-8.0.py:
55 for d in ['/etc/mysql/conf.d', '/etc/mysql/mysql.conf.d']:
56 for f in os.listdir(d):
57 _add_my_conf_files(report, os.path.join(d, f))
...maybe this could be be changed to something like:
```
--- a/debian/additions/source_mysql-8.0.py
+++ b/debian/additions/source_mysql-8.0.py
@@ -54,7 +54,10 @@ def add_info(report):
_add_my_conf_files(report, '/etc/mysql/mysql.cnf')
for d in ['/etc/mysql/conf.d', '/etc/mysql/mysql.conf.d']:
for f in os.listdir(d):
- _add_my_conf_files(report, os.path.join(d, f))
+ try:
+ _add_my_conf_files(report, os.path.join(d, f))
+ except FileNotFoundError:
+ print("Either of /etc/mysql/conf.d or /etc/mysql/mysql.conf.d should be present, exiting..")
try: report['MySQLVarLibDirListing'] = str(os.listdir('/var/lib/mysql'))
except OSError:
Hello Bryce,
Thanks for taking the time to file a bug and making Ubuntu server better! ^.^
In my opinion, I'd expect those two directories to be there, if they're not, then there's something wrong, really. Either a user manipulation or whatever. Maybe instead of the hook failing, it could gracefully exit, mentioning that both the directories aren't present which is somewhat unusual.
The code comes from debian/ additions/ source_ mysql-8. 0.py: mysql/conf. d', '/etc/mysql/ mysql.conf. d']: conf_files( report, os.path.join(d, f))
55 for d in ['/etc/
56 for f in os.listdir(d):
57 _add_my_
...maybe this could be be changed to something like: additions/ source_ mysql-8. 0.py additions/ source_ mysql-8. 0.py my_conf_ files(report, '/etc/mysql/ mysql.cnf' ) mysql/conf. d', '/etc/mysql/ mysql.conf. d']: conf_files( report, os.path.join(d, f)) conf_files( report, os.path.join(d, f)) mysql.conf. d should be present, exiting..")
report[ 'MySQLVarLibDir Listing' ] = str(os. listdir( '/var/lib/ mysql') )
```
--- a/debian/
+++ b/debian/
@@ -54,7 +54,10 @@ def add_info(report):
_add_
for d in ['/etc/
for f in os.listdir(d):
- _add_my_
+ try:
+ _add_my_
+ except FileNotFoundError:
+ print("Either of /etc/mysql/conf.d or /etc/mysql/
try:
except OSError:
```
what do you think?