Convert lazy singleton functions to Singleton object

- simplify the singleton pattern across the codebase
- reduce lines of code needed for crufty initialization
- reduce functions that need to mess with a global

- Singletons whose semantics changed:
  - spack.store.store() -> spack.store
  - spack.repo.path() -> spack.repo.path
  - spack.config.config() -> spack.config.config
  - spack.caches.fetch_cache() -> spack.caches.fetch_cache
  - spack.caches.misc_cache() -> spack.caches.misc_cache
This commit is contained in:
Todd Gamblin
2018-05-16 10:57:40 -07:00
committed by scheibelp
parent 3493f7e793
commit f202198777
66 changed files with 514 additions and 553 deletions

View File

@@ -193,7 +193,7 @@ def set_CrayLoginNode_cmakeOptions(self, spec, cmakeOptions):
# the login node components with this spack invocation. We
# need these paths to be the ones created in the CNL
# spack invocation.
store = spack.store.store()
store = spack.store
be_cbtf = store.db.query_one('cbtf arch=cray-CNL-haswell')
be_cbtfk = store.db.query_one('cbtf-krell arch=cray-CNL-haswell')
be_papi = store.db.query_one('papi arch=cray-CNL-haswell')