refs #2504 add endpoint for GetGitData
parent
950b163602
commit
41a9f7ce21
|
@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [6.2.0] - 2025-07-18
|
||||
|
||||
### Added
|
||||
|
||||
- Add endpoint for GetGitData
|
||||
|
||||
## [6.1.1] - 2025-06-26
|
||||
|
||||
### Changed
|
||||
|
|
|
@ -1032,3 +1032,38 @@ class ogAdmClientWorker (ogLiveWorker):
|
|||
r.update ({ 'nfn':'RESPUESTA_KillJob', 'job':jid })
|
||||
logger.debug (f'r aft ({r})')
|
||||
return r
|
||||
|
||||
@execution_level('full')
|
||||
@check_secret
|
||||
def process_GetGitData (self, path, get_params, post_params, server):
|
||||
logger.debug ('in process_GetGitData, path "{}" get_params "{}" post_params "{}" server "{}"'.format (path, get_params, post_params, server))
|
||||
|
||||
for k in ['nfn', 'dsk', 'par', 'nfn']:
|
||||
if k not in post_params:
|
||||
logger.error (f'required parameter ({k}) not in POST params')
|
||||
return {}
|
||||
|
||||
tmp_gitdata = f'/tmp/gitdata-{self.IPlocal}'
|
||||
nfn = post_params['nfn']
|
||||
dsk = post_params['dsk']
|
||||
par = post_params['par']
|
||||
|
||||
try:
|
||||
self.interfaceAdmin (nfn, [dsk, par, tmp_gitdata])
|
||||
herror = 0
|
||||
except:
|
||||
herror = 1
|
||||
|
||||
if not os.path.exists (tmp_gitdata):
|
||||
return self.respuestaEjecucionComando ({'nfn':'RESPUESTA_GetGitData'}, 1)
|
||||
|
||||
with open (tmp_gitdata, 'r') as fd:
|
||||
gitdata = fd.read().strip()
|
||||
|
||||
branch, repo = gitdata.split (':')
|
||||
cmd = {
|
||||
'nfn': 'RESPUESTA_GetGitData',
|
||||
'branch': branch,
|
||||
'repo': repo,
|
||||
}
|
||||
return self.respuestaEjecucionComando (cmd, herror)
|
||||
|
|
Loading…
Reference in New Issue