| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
logging.warn() is deprecated since 3.3.
And use .error() instead when command is unsupported or client is busy, that
should not ever happen.
|
| |
|
|
|
|
| |
remove call to custom version of legacy script, display warning.
|
|
|
|
| |
Remove image files after a failed image copy operation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add API REST method to fetch an image.
Consolidate image fetch loging for cache/fetch and image/restore.
Resquest payload structure:
{
'image': 'linux.img'
'type': 'TIPTORRENT'
'repository': '12.141.10.2'
}
The client will try to fetch'image' from 'repository' into cache.
Resquest response structure:
{
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
}
|
|
|
|
| |
just a clean up.
|
|
|
|
| |
instead of using info to report errors.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
if image already exists in the cache, skip a second checksum validation.
log shows duplicated entries:
Verifying checksum for example.img, please wait...
Checksum is OK for example.img
Verifying checksum for example.img, please wait...
Checksum is OK for example.img
because tip_check_csum() is called twice in this case.
|
|
|
|
|
|
|
| |
Restoring an updated image file (with different checksum) could fail while the
old checksum file could remain in place.
Remove image and checksum file before fetching the new files.
|
|
|
|
| |
this restore method is unreliable, add warning to the logs.
|
|
|
|
|
| |
after copying file to cache, validate that file exists in cache and checksum
correct.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace ConfigureOs script by native calls to:
- update BCD via hivex using bcd.py and winreg.py infrastructure.
- restore efi bootloader restore_windows_efi_bootloader().
Call legacy scripts for remaining postinstall procedures to
replace them incrementally.
Define variable CONFIGUREOS_LEGACY_ENABLED as False by default.
Run legacy configureOs when CONFIGUREOS_LEGACY_ENABLED = True.
This serves as a auxiliar method to keep the restoration functional
in case of problems with the new configure_os logic.
|
|
|
|
| |
Use a more consistent name format for the ogExtendFs function.
|
|
|
|
|
|
|
|
|
|
| |
If formatting fails, log shows:
mkfs.ntfs reports return code 1 for /dev/sda2
but ogclient reports success to the ogserver.
Raise an exception so front-end gets an indication that formatting has failed.
|
|
|
|
| |
Provide a bit more logging to make it easier to debug issues.
|
|
|
|
| |
For consistency with tiptorrent download.
|
|
|
|
| |
Report image checksum to ogserver through HTTP response.
|
|
|
|
| |
check sufficient permissions and bail out in case of issues.
|
|
|
|
|
|
|
|
| |
Add explicit check for .full.sum after downloading it.
Rewrite errors log, one of them is misleading when checksum validation
fails, it refers to missing .full.sum, but it could be a different
reason.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Try to find the script to run for a shell/run request in
/opt/opengnsys/shell/, restricted mode is enabled if the
script is found.
Excute the script without shell=True and executable=OG_SHELL in
restricted mode.
Restricted mode is a safer execution method as it only executes
code manually defined by the administrator.
Each script needs to define a shebang, this way more than just bash
is supported.
|
|
|
|
|
| |
echo command that has been run for storage in ogserver, until GET /shell/output
is invoked.
|
|
|
|
|
|
|
|
| |
provide return code as result to ogserver.
Update virtual mode driver to return dummy value, although this command
is unimplemented, this seems to be broken due to possible TypeError when
accessing result from caller.
|
|
|
|
|
|
| |
Properly report the lack of cache partition when restoring an
image using TIPTORRENT and UNICAST as methods.
Abort any restore in case of no cache partition.
|
|
|
|
|
|
|
| |
Fix image size, permissions and creation time.
Improve error report related to these parameters now showing the
exact cause of the problem if any occurred during the definition
of image size, file permissions or image creation time values.
|
|
|
|
|
| |
Add logging before calculating checksum to provide a hint to user on what is
going on while ogClient is still busy.
|
|
|
|
|
|
| |
Rename ogGetImageInfo to get_image_info.
Move code from ogOperations.py to obtain image data into
get_image_info.
|
|
|
|
|
| |
legacy.py contais mostly functions related to system images.
Rename the file to better represent the contents in it.
|
|
|
|
|
|
| |
Use the constant OG_CACHE_IMAGE_PATH from cache.py to obtain the
location of the directory where images are stored.
This way the path can be changed from one single point.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a 'cache' field into the json payload the client sends to
the server after a restore operation so the server can update
the new cache contents.
Resquest response structure:
{
...
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
...
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add API REST method to delete cache contents.
Resquest payload structure:
{
'images': ['windows.img', 'linux.img']
}
The client will try to delete as many images in cache as available
with names matching the list of filenames in the 'images' field.
Resquest response structure:
{
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the list of images in the client's cache partition in the
payload sent to the server.
The information sent is a list of {image_name, img_size, checksum}
elements where img_size is the size of the respective image in bytes.
Resquest response structure:
{
...
'cache': [
{'name': 'windows.img', 'size': 2432370213, checksum: '5d4dcc677bc19f40a647d0002f4ade90'},
{'name': 'linux.img', 'size': 243234534213, checksum: '3eb22f888f88a55ad954f55644e1192e'}
]
...
}
|
|
|
|
| |
Never used what configureOs() returns, remove it.
|
|
|
|
| |
checksum file name end by .img.full.sum, not .full.sum
|
|
|
|
| |
Just a simple cleanup.
|
|
|
|
|
|
|
|
| |
This method reports the /dev path to cache partition, rename it.
Add explicit check if blkid is successful.
And add logging to report that device path to cache is not found.
|
|
|
|
|
|
|
| |
ogCP expects LINUX-SWAP to specify a swap filesystem.
Add a similar workaround to the one that is done for VFAT for symmetry between
inputs and outputs that circulate over the API.
|
|
|
|
|
| |
Specify that image file cannot be found in cache because tiptorrent has failed,
otherwise it is confusing.
|
|
|
|
| |
Otherwise mkfs silently fails because OS reports out-of-sync partition table.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
partprobe requires that all disk partitions are unmounted.
partprobe needs to be called to report the OS that the partition table
has changed, otherwise ogclient reports incorrect partition information.
iterate over the partition list and mount cache after partprobe is
called.
|
|
|
|
|
| |
If new partition layout is specified, unmount cache and any other partition
under /mnt.
|
|
|
|
|
|
|
| |
tip_client_get raises the proper error exceptions but the except
block in _restore_image_tiptorrent overwrites the reported error.
Move the raise statements in _restore_image_tiptorrent outside
of the except block.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reduce the scope of the try except block that controls the case
of deleting the image backup in case of error. Now it only covers
the section of code after backup creation and up to image
verification. Check when the Exception is an OgError to raise
with added context.
Prevent the deletion of the target image in case of error before
the backup creation.
Bundle the backup creation on its own try except block to give
more feedback on a failed backup creation.
Enables a better error management allowing unhandled
exceptions to be reported properly.
|
|
|
|
|
|
|
|
| |
Capture only the relevant exception types in each except block.
The capture of the Exception type means hiding information for
unhandled error cases, even for syntax errors in the codebase.
Using a more fine grained exception filtering improves error
traceability.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Log an error message in known error cases and log a backtrace
otherwise.
Define a new error type OgError to be used in all the 'raise'
blocks to define the error message to log. The exception
propagates until it reaches send_internal_server_error() where
the exception type is checked. If the type is OgError we log
the exception message. Logs the backtrace for other types.
The initial error implementation printed a backtrace everytime
an error ocurred. The next iteration changed it to only print
a backtrace in a very particular case but ended up omiting too
much information such as syntax errors or unknown error context.
The actual implementation only logs the cases we already cover in
the codebase and logs a bracktrace in the others, enabling a
better debugging experience.
|
|
|
|
|
|
|
|
| |
This reverts commit 57787dab5499a38915b5e2f702844553abd2ea2a.
Read from stderr is blocking if no data is available, revert this patch since
ogClient hangs indefinitely in lzop invocations due to races in process
execution through Popen.
|
|
|
|
| |
instead of using debug level, this is very useful to track the process.
|
|
|
|
|
|
|
| |
Restore image file from .ant to original file name if new image
creation fails. Remove new imagen and move the .ant image file in
place of the original as previously an error meant a rename of the
image file without a revert to keep the image available.
|
|
|
|
|
|
|
|
| |
Implement a Python equivalent of ogCopyEfiBootLoader as the
function copy_efi_bootloader. This function copies the contents of
the folder of the EFI loader in the ESP into a ogBoot folder at
the root of the partition target of an image creation.
copy_efi_bootloader is a Windows only functionality.
|