Commit graph

7 commits

Author SHA1 Message Date
Teodora Sechkova
c29051cc4b Move non-public modules to nglient/_internal
Separate public/private API. Keep modules
containing the piblic classes in the main client
directory and move the rest to _internal.

Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
2021-05-21 10:00:00 +03:00
Teodora Sechkova
c64a6f92c1 Rename client_rework to ngclient
The current client and the next-gen client should
coexist in the same repository during the ongoing
development of the latter.

Looking for a name which is client-related,
short, meeting PEP8 package names requirements.
Currently "ngclient" seems to fit in until a
better proposal comes.

Rename updater_rework.py to updater.py

Signed-off-by: Teodora Sechkova <tsechkova@vmware.com>
2021-05-21 10:00:00 +03:00
Jussi Kukkonen
f2cff951a6 MetadataBundle: Don't do any file IO
Remove file IO from MetadataBundle:
* This make the bundle API very clear and easy to understand
* This means caller must now read from and persist data to disk
  but initial prototypes suggest this won't make Updater too
  complex

This change is something we can still back out from if it turns out to
be the wrong decision: the file-persisting MetadataBundle has been tested
and works fine.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2021-05-16 12:30:06 +03:00
Jussi Kukkonen
b86d1f733f MetadataBundle: Raise instead of returning bool
The bundle should now raise
* derivatives of RepositoryError on failures that are likely a result
  of server error or a malicious server
* RuntimeErrors if calls were made when they are not possible
* ValueErrors if arguments are invalid

last two are callers errors and avoidable.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2021-05-16 10:48:59 +03:00
Jussi Kukkonen
eb648d19bc MetadataBundle: Save original files on disk
Don't use the serialized format as that won't match any hashes in
"meta".

Add basic tests for updating metadata.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2021-05-16 10:48:59 +03:00
Jussi Kukkonen
2d155faae6 MetadataBundle: Change ValueErrors to RuntimeErrors
As the metadata type is no longer an argument, these are not
ValueErrors.

Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2021-05-16 10:48:59 +03:00
Jussi Kukkonen
0bbfe038cf tests: Add minimal test case for Bundle
Signed-off-by: Jussi Kukkonen <jkukkonen@vmware.com>
2021-05-16 10:48:59 +03:00