| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Maybe result of a partial download? then, remove it to leave cache in consistent
state.
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
DE94BBA4-06D1-4D40-A16A-BFD50179D6AC is already set in in GUID_MAP as partition
code, but not in GPT_PARTTYPES.
|
|
|
|
|
| |
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.
|
|
|
|
| |
Add 0xef partition type for EFI in MBR.
|
|
|
|
| |
Remove reference to external website in code.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Use "Microsoft basic data partition" to store FAT32 in case of GPT partition
scheme and 0xB according in case of MBR partition scheme according to
documentation.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|