← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:charm-db-layer into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:charm-db-layer into launchpad:master.

Commit message:
charm: Update launchpad-layers to 42a4b4c4f6

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/442740

This splits out new `launchpad-payload` and `launchpad-db` layers, requiring some minor restructuring of individual charms.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:charm-db-layer into launchpad:master.
diff --git a/charm/launchpad-admin/charmcraft.yaml b/charm/launchpad-admin/charmcraft.yaml
index e640df9..c27c604 100644
--- a/charm/launchpad-admin/charmcraft.yaml
+++ b/charm/launchpad-admin/charmcraft.yaml
@@ -35,12 +35,14 @@ parts:
     after:
       - ols-layers
     source: https://git.launchpad.net/launchpad-layers
-    source-commit: "6a50917f5f6163069ae1661e3320abb5b48173a3"
+    source-commit: "42a4b4c4f62936b1d050c775e84f7364dfb5efc0"
     source-submodules: []
     source-type: git
     plugin: dump
     organize:
       launchpad-base: layers/layer/launchpad-base
+      launchpad-db: layers/layer/launchpad-db
+      launchpad-payload: layers/layer/launchpad-payload
     stage:
       - layers
     prime:
diff --git a/charm/launchpad-admin/layer.yaml b/charm/launchpad-admin/layer.yaml
index 352e6d4..46351e2 100644
--- a/charm/launchpad-admin/layer.yaml
+++ b/charm/launchpad-admin/layer.yaml
@@ -1,5 +1,5 @@
 includes:
-  - layer:launchpad-base
+  - layer:launchpad-db
 repo: https://git.launchpad.net/launchpad
 options:
   apt:
diff --git a/charm/launchpad-admin/reactive/launchpad-admin.py b/charm/launchpad-admin/reactive/launchpad-admin.py
index 3d44168..0d3d311 100644
--- a/charm/launchpad-admin/reactive/launchpad-admin.py
+++ b/charm/launchpad-admin/reactive/launchpad-admin.py
@@ -5,14 +5,9 @@ import os.path
 import subprocess
 
 from charmhelpers.core import hookenv, host, templating
-from charms.launchpad.base import (
-    configure_email,
-    configure_lazr,
-    get_service_config,
-    home_dir,
-    strip_dsn_authentication,
-    update_pgpass,
-)
+from charms.launchpad.base import configure_email, get_service_config
+from charms.launchpad.db import strip_dsn_authentication, update_pgpass
+from charms.launchpad.payload import configure_lazr, home_dir
 from charms.reactive import (
     endpoint_from_flag,
     remove_state,
@@ -80,7 +75,7 @@ def update_database_permissions():
 
 
 @when(
-    "launchpad.base.configured",
+    "launchpad.db.configured",
     "db.master.available",
     "db-admin.master.available",
     "session-db.master.available",
@@ -145,7 +140,12 @@ def configure():
 
 
 @when("service.configured")
-@when_not_all("db-admin.master.available", "session-db.master.available")
+@when_not_all(
+    "launchpad.db.configured",
+    "db.master.available",
+    "db-admin.master.available",
+    "session-db.master.available",
+)
 def deconfigure():
     remove_state("service.configured")
 
diff --git a/charm/launchpad-admin/templates/launchpad-admin-lazr.conf b/charm/launchpad-admin/templates/launchpad-admin-lazr.conf
index 24a41f9..781303a 100644
--- a/charm/launchpad-admin/templates/launchpad-admin-lazr.conf
+++ b/charm/launchpad-admin/templates/launchpad-admin-lazr.conf
@@ -9,7 +9,7 @@
 {% from "macros.j2" import opt -%}
 
 [meta]
-extends: ../launchpad-base-lazr.conf
+extends: ../launchpad-db-lazr.conf
 
 [database]
 rw_main_primary: {{ db_admin_primary }}
diff --git a/charm/launchpad-appserver/charmcraft.yaml b/charm/launchpad-appserver/charmcraft.yaml
index 14708d5..5e7f772 100644
--- a/charm/launchpad-appserver/charmcraft.yaml
+++ b/charm/launchpad-appserver/charmcraft.yaml
@@ -35,12 +35,14 @@ parts:
     after:
       - ols-layers
     source: https://git.launchpad.net/launchpad-layers
-    source-commit: "6a50917f5f6163069ae1661e3320abb5b48173a3"
+    source-commit: "42a4b4c4f62936b1d050c775e84f7364dfb5efc0"
     source-submodules: []
     source-type: git
     plugin: dump
     organize:
       launchpad-base: layers/layer/launchpad-base
+      launchpad-db: layers/layer/launchpad-db
+      launchpad-payload: layers/layer/launchpad-payload
     stage:
       - layers
     prime:
diff --git a/charm/launchpad-appserver/layer.yaml b/charm/launchpad-appserver/layer.yaml
index 87a5643..1401723 100644
--- a/charm/launchpad-appserver/layer.yaml
+++ b/charm/launchpad-appserver/layer.yaml
@@ -1,5 +1,5 @@
 includes:
-  - layer:launchpad-base
+  - layer:launchpad-db
   - layer:coordinator
   - interface:memcache
 repo: https://git.launchpad.net/launchpad
diff --git a/charm/launchpad-appserver/reactive/launchpad-appserver.py b/charm/launchpad-appserver/reactive/launchpad-appserver.py
index 61cd796..ad4b439 100644
--- a/charm/launchpad-appserver/reactive/launchpad-appserver.py
+++ b/charm/launchpad-appserver/reactive/launchpad-appserver.py
@@ -7,16 +7,17 @@ from multiprocessing import cpu_count
 
 from charmhelpers.core import hookenv, host, templating
 from charms.coordinator import acquire
-from charms.launchpad.base import (
-    config_file_path,
-    configure_cron,
-    configure_email,
-    configure_lazr,
-    get_service_config,
+from charms.launchpad.base import configure_email, get_service_config
+from charms.launchpad.db import (
     lazr_config_files,
     strip_dsn_authentication,
     update_pgpass,
 )
+from charms.launchpad.payload import (
+    config_file_path,
+    configure_cron,
+    configure_lazr,
+)
 from charms.reactive import (
     clear_flag,
     endpoint_from_flag,
@@ -28,6 +29,7 @@ from charms.reactive import (
     when,
     when_none,
     when_not,
+    when_not_all,
 )
 from ols import base, postgres
 from psycopg2.extensions import parse_dsn
@@ -93,7 +95,7 @@ def config_files():
 
 
 @when(
-    "launchpad.base.configured",
+    "launchpad.db.configured",
     "session-db.master.available",
     "memcache.available",
 )
@@ -155,7 +157,11 @@ def check_is_running():
 
 
 @when("service.configured")
-@when_not("session-db.master.available")
+@when_not_all(
+    "launchpad.db.configured",
+    "session-db.master.available",
+    "memcache.available",
+)
 def deconfigure():
     remove_state("service.configured")
 
diff --git a/charm/launchpad-appserver/templates/launchpad-appserver-lazr.conf b/charm/launchpad-appserver/templates/launchpad-appserver-lazr.conf
index a7e2c95..642d52e 100644
--- a/charm/launchpad-appserver/templates/launchpad-appserver-lazr.conf
+++ b/charm/launchpad-appserver/templates/launchpad-appserver-lazr.conf
@@ -9,7 +9,7 @@
 {% from "macros.j2" import opt -%}
 
 [meta]
-extends: ../launchpad-base-lazr.conf
+extends: ../launchpad-db-lazr.conf
 
 [bing]
 {{- opt("custom_config_id", bing_custom_config_id) }}
diff --git a/charm/launchpad-librarian/charmcraft.yaml b/charm/launchpad-librarian/charmcraft.yaml
index f56aaa5..07b75c0 100644
--- a/charm/launchpad-librarian/charmcraft.yaml
+++ b/charm/launchpad-librarian/charmcraft.yaml
@@ -35,12 +35,14 @@ parts:
     after:
       - ols-layers
     source: https://git.launchpad.net/launchpad-layers
-    source-commit: "6a50917f5f6163069ae1661e3320abb5b48173a3"
+    source-commit: "42a4b4c4f62936b1d050c775e84f7364dfb5efc0"
     source-submodules: []
     source-type: git
     plugin: dump
     organize:
       launchpad-base: layers/layer/launchpad-base
+      launchpad-db: layers/layer/launchpad-db
+      launchpad-payload: layers/layer/launchpad-payload
     stage:
       - layers
     prime:
diff --git a/charm/launchpad-librarian/layer.yaml b/charm/launchpad-librarian/layer.yaml
index 4e629d0..cdfe1c7 100644
--- a/charm/launchpad-librarian/layer.yaml
+++ b/charm/launchpad-librarian/layer.yaml
@@ -1,5 +1,5 @@
 includes:
-  - layer:launchpad-base
+  - layer:launchpad-db
 repo: https://git.launchpad.net/launchpad
 options:
   apt:
diff --git a/charm/launchpad-librarian/reactive/launchpad-librarian.py b/charm/launchpad-librarian/reactive/launchpad-librarian.py
index 349f22a..67cc398 100644
--- a/charm/launchpad-librarian/reactive/launchpad-librarian.py
+++ b/charm/launchpad-librarian/reactive/launchpad-librarian.py
@@ -5,16 +5,17 @@ import os.path
 import subprocess
 
 from charmhelpers.core import hookenv, host, templating
-from charms.launchpad.base import (
-    config_file_path,
-    configure_cron,
-    configure_email,
-    configure_lazr,
-    get_service_config,
+from charms.launchpad.base import configure_email, get_service_config
+from charms.launchpad.db import (
     lazr_config_files,
     strip_dsn_authentication,
     update_pgpass,
 )
+from charms.launchpad.payload import (
+    config_file_path,
+    configure_cron,
+    configure_lazr,
+)
 from charms.reactive import (
     endpoint_from_flag,
     helpers,
@@ -22,6 +23,7 @@ from charms.reactive import (
     set_state,
     when,
     when_not,
+    when_not_all,
 )
 from ols import base, postgres
 from psycopg2.extensions import parse_dsn
@@ -73,7 +75,7 @@ def config_files():
     "config.set.port_restricted_download_base",
     "config.set.port_restricted_upload_base",
     "config.set.port_upload_base",
-    "launchpad.base.configured",
+    "launchpad.db.configured",
     "session-db.master.available",
 )
 @when_not("service.configured")
@@ -149,7 +151,14 @@ def check_is_running():
 
 
 @when("service.configured")
-@when_not("session-db.master.available")
+@when_not_all(
+    "config.set.port_download_base",
+    "config.set.port_restricted_download_base",
+    "config.set.port_restricted_upload_base",
+    "config.set.port_upload_base",
+    "launchpad.db.configured",
+    "session-db.master.available",
+)
 def deconfigure():
     remove_state("service.configured")
 
diff --git a/charm/launchpad-librarian/templates/launchpad-librarian-lazr.conf b/charm/launchpad-librarian/templates/launchpad-librarian-lazr.conf
index 5cc7c8b..a28e217 100644
--- a/charm/launchpad-librarian/templates/launchpad-librarian-lazr.conf
+++ b/charm/launchpad-librarian/templates/launchpad-librarian-lazr.conf
@@ -9,7 +9,7 @@
 {% from "macros.j2" import opt -%}
 
 [meta]
-extends: ../launchpad-base-lazr.conf
+extends: ../launchpad-db-lazr.conf
 
 [launchpad_session]
 database: {{ db_session }}
diff --git a/charm/launchpad/charmcraft.yaml b/charm/launchpad/charmcraft.yaml
index b3205bf..e7ec243 100644
--- a/charm/launchpad/charmcraft.yaml
+++ b/charm/launchpad/charmcraft.yaml
@@ -35,12 +35,13 @@ parts:
     after:
       - ols-layers
     source: https://git.launchpad.net/launchpad-layers
-    source-commit: "6a50917f5f6163069ae1661e3320abb5b48173a3"
+    source-commit: "42a4b4c4f62936b1d050c775e84f7364dfb5efc0"
     source-submodules: []
     source-type: git
     plugin: dump
     organize:
       launchpad-base: layers/layer/launchpad-base
+      launchpad-payload: layers/layer/launchpad-payload
     stage:
       - layers
     prime: