Adds check to ensure db_sync can be overridden.

Added arg and if statement prevents db_sync from being run where db service is not active i.e. the compute. This is used by openstack module for computes so they dont trigger db_sync.