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

Proposed by Ines Almeida
Status: Merged
Approved by: Ines Almeida
Approved revision: 3dd85f1e59a578a5f057a7c434cc26e1e33e71a0
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ines-almeida/txpkgupload:fix-txpkgupload-service-charm
Merge into: txpkgupload:master
Diff against target: 67 lines (+18/-4)
4 files modified
charm/txpkgupload/README.md (+13/-2)
charm/txpkgupload/config.yaml (+1/-1)
charm/txpkgupload/reactive/txpkgupload.py (+3/-1)
charm/txpkgupload/templates/txpkgupload.socket.j2 (+1/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+447914@code.launchpad.net

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

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve
f2aece3... by Ines Almeida

Update ListenStream socket port and sftp_authentication_endpoint default value

3dd85f1... by Ines Almeida

Create temp directory where files are placed before being sent to fsroot

Update README with details about the txpkgupload relation with the principal charm

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charm/txpkgupload/README.md b/charm/txpkgupload/README.md
2index 962ff38..8d9b491 100644
3--- a/charm/txpkgupload/README.md
4+++ b/charm/txpkgupload/README.md
5@@ -15,9 +15,20 @@ provides:
6 ```
7
8 As this is a subordinate charm, it will be deployed to the same machine as its
9-principal charm. The charm will not deploy before the relation to its principal is set.
10-You will need the following relations:
11+principal charm. The charm will not deploy before the relation to its principal
12+is set. You will need the following relations:
13
14 ```shell
15 juju relate txpkgupload <name of principal application>
16 ```
17+
18+The principal charm should create an `fsroot` directory and set up txpkgupload
19+with something along the lines of:
20+
21+```python
22+ txpkgupload = endpoint_from_flag("upload-queue-processor.available")
23+ txpkgupload.set_config(fsroot=fsroot)
24+```
25+
26+Note: Ensure that the `txpkgupload` user has `write` and `execute` access to
27+the `fsroot` directory.
28diff --git a/charm/txpkgupload/config.yaml b/charm/txpkgupload/config.yaml
29index 8257478..34d4410 100644
30--- a/charm/txpkgupload/config.yaml
31+++ b/charm/txpkgupload/config.yaml
32@@ -9,7 +9,7 @@ options:
33 description: The prefix used when generating OOPS reports.
34 sftp_authentication_endpoint:
35 type: string
36- default: http://xmlrpc-private.launchpad.dev:8087/authserver
37+ default: http://xmlrpc-private.launchpad.test:8087/authserver
38 description: The URL of the XML-RPC endpoint for authentication handling of SSH users.
39 sftp_host_key_private:
40 type: string
41diff --git a/charm/txpkgupload/reactive/txpkgupload.py b/charm/txpkgupload/reactive/txpkgupload.py
42index 39d224c..2ec1e90 100644
43--- a/charm/txpkgupload/reactive/txpkgupload.py
44+++ b/charm/txpkgupload/reactive/txpkgupload.py
45@@ -84,7 +84,9 @@ def get_config():
46 )
47
48 oopses_dir = os.path.join(base.base_dir(), "oopses")
49- host.mkdir(oopses_dir, group=base.user(), perms=0o775)
50+ host.mkdir(oopses_dir, owner=base.user(), group=base.user(), perms=0o775)
51+ temp_dir = os.path.join(base.base_dir(), "tmp-incoming")
52+ host.mkdir(temp_dir, owner=base.user(), group=base.user(), perms=0o775)
53 config["oopses_dir"] = oopses_dir
54 # Fetch data received from the parent upload queue processor service
55 uploader_relation = endpoint_from_flag("upload-queue-processor.configured")
56diff --git a/charm/txpkgupload/templates/txpkgupload.socket.j2 b/charm/txpkgupload/templates/txpkgupload.socket.j2
57index cd54306..2bdfdf9 100644
58--- a/charm/txpkgupload/templates/txpkgupload.socket.j2
59+++ b/charm/txpkgupload/templates/txpkgupload.socket.j2
60@@ -3,6 +3,7 @@ Description=Twisted package uploader service
61
62 [Socket]
63 ListenStream={{ sftp_port }}
64+ListenStream={{ ftp_port }}
65
66 [Install]
67 WantedBy=sockets.target

Subscribers

People subscribed via source and target branches

to all changes: