You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, the PersistenceEngine class has a hard-coded list of drivers (_drivers) instead of reading the corresponding directory: pypelib/persistence/backends/.
Hard-coded settings
Models inside pyPElib driver's (e.g. RuleModel and RuleTableModel) include hard-coded settings:
class PolicyRuleModel(models.Model):
class Meta:
"""Machine exportable class"""
app_label = 'vt_manager'
db_table = 'pypelib_RuleModel'
that should be kept out of the code and be intuitive and easily configurable by a user, e.g. in /etc/pypelib/conf.d/.
Dynamic settings loading
After improving the previous point the settings will be outside the library, thus it would be interesting ( though maybe a bit performance costly, if heavily used ) to dynamically load these before performing any operation.
That could be done in a common code for every driver, e.g. the method _getDriver inside the PersistenceEngine class. Since this method is called prior to perform any operation it seems a good common point to load the settings file.
Note: the load of settings should be coded in a separate module.
The text was updated successfully, but these errors were encountered:
We may also need some kind of parameter to avoid asking about the application and database names (in which PyPElib data will be stored) inside ofver, since this seems to confuse users.
Hard-coded drivers
Also, the
PersistenceEngine
class has a hard-coded list of drivers (_drivers
) instead of reading the corresponding directory:pypelib/persistence/backends/
.Hard-coded settings
Models inside pyPElib driver's (e.g.
RuleModel
andRuleTableModel
) include hard-coded settings:that should be kept out of the code and be intuitive and easily configurable by a user, e.g. in
/etc/pypelib/conf.d/
.Dynamic settings loading
After improving the previous point the settings will be outside the library, thus it would be interesting ( though maybe a bit performance costly, if heavily used ) to dynamically load these before performing any operation.
That could be done in a common code for every driver, e.g. the method
_getDriver
inside thePersistenceEngine
class. Since this method is called prior to perform any operation it seems a good common point to load the settings file.Note: the load of settings should be coded in a separate module.
The text was updated successfully, but these errors were encountered: