Implemented conversion of files section from AutoYaST xml format to Agama JSON#2125
Implemented conversion of files section from AutoYaST xml format to Agama JSON#2125jreidinger merged 5 commits intofiles_autofrom
Conversation
|
|
||
| files_json = files.reduce([]) do |res, file| | ||
| # Currently we support only url to file source | ||
| file["source"] = file.delete("file_location") |
There was a problem hiding this comment.
I think you get rust part wrong. There are two enum options:
- url ( here file location )
- content ( the file_content )
so in the end only file_script should not be supported.
There was a problem hiding this comment.
ok ... that's why this is a draft for discussion
| # Currently we support only url to file source | ||
| file["source"] = file.delete("file_location") | ||
| file["destination"] = file.delete("file_path") | ||
| file["permissions"] = file.delete("file_permissions") |
There was a problem hiding this comment.
what is exact autoyast format? rust part do not support "0o" so it should look like "777" or "0640" is possible, but not "0o644"
There was a problem hiding this comment.
well in documentation / example was 444 ... in AY's rng is "STRING" . No other definition found so far.
| return {} if file.nil? || file.empty? | ||
|
|
||
| if file.key?("file_location") | ||
| { "source": { "url": file["file_location"] } } |
There was a problem hiding this comment.
this is still not correct. "source should not be there. We use same format as scripts: https://agama-project.github.io/docs/user/unattended/scripts#scripts-definition
There was a problem hiding this comment.
i worked according to https://serde.rs/enum-representations.html ... and then for whatever reason added struct member name "source" :-/
|
|
||
| file["destination"] = f["file_path"] if f["file_path"] | ||
| file["permissions"] = f["file_permissions"] if f["file_permissions"] | ||
| file["owner"] = f["file_owner"] if f["file_owner"] |
There was a problem hiding this comment.
as mentioned we will need to translate dot into colon as agama will use "root:root" and autoyast according to docu I found uses "root.root" see https://documentation.suse.com/sles/15-SP5/html/SLES-all/cha-configuration-installation-options.html#id-1.7.5.2.38.11
There was a problem hiding this comment.
as discussed with imo files won't have owner field and instead there will be user and group field.
There was a problem hiding this comment.
so instead of { "owner": "user:group" } add two json members { "user": "user", "group": "group" }? Ok, will update accordingly
|
I will merge it now and fine tune and test it in my branch together. |
Prepare for releasing Agama 13: - #2041 - #2074 - #2088 - #2089 - #2094 - #2097 - #2098 - #2100 - #2101 - #2104 - #2106 - #2107 - #2108 - #2113 - #2115 - #2116 - #2117 - #2118 - #2120 - #2121 - #2122 - #2123 - #2124 - #2125 - #2126 - #2128 - #2132 - #2135 - #2136 - #2137 - #2139 - #2142 - #2145 - #2146 - #2147 - #2148 - #2151 - #2153 - #2155 - #2156 - #2157 - #2158 - #2159 - #2160 - #2161 - #2163 - #2165 - #2172 - #2174 - #2177 - #2179 - #2180 - #2181 - #2182 - #2183 - #2184 - #2186 - #2187 - #2188 - #2191 - #2192 - #2193 - #2195 - #2197 - #2198 - #2199 - #2200 - #2201 - #2203 - #2204 - #2205 - #2206 - #2207 - #2209 - #2212 - #2213 - #2214 - #2215 - #2216

Problem
We want to (partially) support files section when converting old AY profile into Agama's new json based
Solution
implemented files reader for Agama's AutoYaST converter.
For now only static file sources are supported no dynamic files allowed (files embedded into the profile)
Testing