|
36 | 36 | from app.im import InfrastructureManager |
37 | 37 | from app.ssh_key import SSHKey |
38 | 38 | from app.ott import OneTimeTokenData |
39 | | -from app import utils, db |
40 | | -from app import appdb as sitesInfo |
| 39 | +from app import utils, appdb, db |
41 | 40 | from app.vault_info import VaultInfo |
42 | 41 | from oauthlib.oauth2.rfc6749.errors import InvalidTokenError, TokenExpiredError, InvalidGrantError |
43 | 42 | from werkzeug.exceptions import Forbidden |
@@ -778,8 +777,8 @@ def getsites(vo=None): |
778 | 777 | for site_name, site in static_sites.items(): |
779 | 778 | res += '<option name="selectedSite" value=%s>%s</option>' % (site['url'], site_name) |
780 | 779 |
|
781 | | - sites = utils.getSiteInfoProvider().get_sites(vo) |
782 | | - for site_name, site in sites.items(): |
| 780 | + appdb_sites = appdb.get_sites(vo) |
| 781 | + for site_name, site in appdb_sites.items(): |
783 | 782 | # avoid site duplication |
784 | 783 | if site_name not in static_sites: |
785 | 784 | if site["state"]: |
@@ -808,7 +807,7 @@ def getimages(cred_id=None): |
808 | 807 |
|
809 | 808 | else: |
810 | 809 | site, _, vo = utils.get_site_info(cred_id, cred, get_cred_id()) |
811 | | - for image_name, image_id in utils.getSiteInfoProvider().get_images(site['id'], vo): |
| 810 | + for image_name, image_id in appdb.get_images(site['id'], vo): |
812 | 811 | res += '<option name="selectedImage" value=%s>%s</option>' % (image_id, image_name) |
813 | 812 | return res |
814 | 813 |
|
@@ -1540,7 +1539,7 @@ def handle_csrf_error(e): |
1540 | 1539 | # Reload internally the site cache |
1541 | 1540 | @scheduler.task('interval', id='reload_sites', seconds=5) |
1542 | 1541 | def reload_sites(): |
1543 | | - scheduler.modify_job('reload_sites', trigger='interval', seconds=settings.sites_cache_timeout - 30) |
| 1542 | + scheduler.modify_job('reload_sites', trigger='interval', seconds=settings.appdb_cache_timeout - 30) |
1544 | 1543 | with app.app_context(): |
1545 | 1544 | app.logger.debug('Reload Site List.') |
1546 | 1545 | g.settings = settings |
|
0 commit comments