← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~ines-almeida/txpkgupload:fix-txpkgupload-service-charm into txpkgupload:master

 

Ines Almeida has proposed merging ~ines-almeida/txpkgupload:fix-txpkgupload-service-charm into txpkgupload:master.

Commit message:
Create temp directory in reactive code and update ListenStream socket to use ftp port

Update the README to ensure principal charm is setup correctly and update default value for sftp_authentication_endpoint

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~ines-almeida/txpkgupload/+git/txpkgupload/+merge/447914
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~ines-almeida/txpkgupload:fix-txpkgupload-service-charm into txpkgupload:master.
diff --git a/charm/txpkgupload/README.md b/charm/txpkgupload/README.md
index 962ff38..fa1f8de 100644
--- a/charm/txpkgupload/README.md
+++ b/charm/txpkgupload/README.md
@@ -15,9 +15,20 @@ provides:
 ```
 
 As this is a subordinate charm, it will be deployed to the same machine as its
-principal charm. The charm will not deploy before the relation to its principal is set.
-You will need the following relations:
+principal charm. The charm will not deploy before the relation to its principal
+is set. You will need the following relations:
 
 ```shell
 juju relate txpkgupload <name of principal application>
 ```
+
+The principal charm should create an `fsroot` directory and set up txpkgupload
+with something on the lines of:
+
+```python
+    txpkgupload = endpoint_from_flag("upload-queue-processor.available")
+    txpkgupload.set_config(fsroot=fsroot)
+```
+
+Note: Ensure that the `txpkgupload` user has `write` and `execute` access to
+the `fsroot` directory.
diff --git a/charm/txpkgupload/config.yaml b/charm/txpkgupload/config.yaml
index 8257478..34d4410 100644
--- a/charm/txpkgupload/config.yaml
+++ b/charm/txpkgupload/config.yaml
@@ -9,7 +9,7 @@ options:
     description: The prefix used when generating OOPS reports.
   sftp_authentication_endpoint:
     type: string
-    default: http://xmlrpc-private.launchpad.dev:8087/authserver
+    default: http://xmlrpc-private.launchpad.test:8087/authserver
     description: The URL of the XML-RPC endpoint for authentication handling of SSH users.
   sftp_host_key_private:
     type: string
diff --git a/charm/txpkgupload/reactive/txpkgupload.py b/charm/txpkgupload/reactive/txpkgupload.py
index 39d224c..2ec1e90 100644
--- a/charm/txpkgupload/reactive/txpkgupload.py
+++ b/charm/txpkgupload/reactive/txpkgupload.py
@@ -84,7 +84,9 @@ def get_config():
     )
 
     oopses_dir = os.path.join(base.base_dir(), "oopses")
-    host.mkdir(oopses_dir, group=base.user(), perms=0o775)
+    host.mkdir(oopses_dir, owner=base.user(), group=base.user(), perms=0o775)
+    temp_dir = os.path.join(base.base_dir(), "tmp-incoming")
+    host.mkdir(temp_dir, owner=base.user(), group=base.user(), perms=0o775)
     config["oopses_dir"] = oopses_dir
     # Fetch data received from the parent upload queue processor service
     uploader_relation = endpoint_from_flag("upload-queue-processor.configured")
diff --git a/charm/txpkgupload/templates/txpkgupload.socket.j2 b/charm/txpkgupload/templates/txpkgupload.socket.j2
index cd54306..417a629 100644
--- a/charm/txpkgupload/templates/txpkgupload.socket.j2
+++ b/charm/txpkgupload/templates/txpkgupload.socket.j2
@@ -2,7 +2,7 @@
 Description=Twisted package uploader service
 
 [Socket]
-ListenStream={{ sftp_port }}
+ListenStream={{ ftp_port }}
 
 [Install]
 WantedBy=sockets.target