hologos / tpcp Goto Github PK
View Code? Open in Web Editor NEWA smart tool to remotely work with SAP import queue and transports.
License: MIT License
A smart tool to remotely work with SAP import queue and transports.
License: MIT License
It would be nice to process a transport for all systems from landscape specifying only system group.
I need to set the directory to store all logs from outside.
Since processing actions is run as background job, filling data to SAPTRANSPORT_TRANSPORT_DOMAINS_MAP
array in one thread doesn't affect the array in other threads.
System informations are now hardcoded in the script. It needs to be loaded from a configuration file.
Log messages are printed to STDERR and needs to be redirected to a file with 2> filename
or it breaks the rendering.
Needs futher investigation. Here is what I think is happening:
If multiple threads tries to connect to the same host, the very first one detects that no master connection is created. So it creates one. But in meantime other threads detect that master connection is opened but it actually isn't fully initialized yet.
I removed calling of tpcp::utils::cleanup()
in traps but don't remember the exact reason. It had something to do with my shell (zsh) automatically calling traps even on successful execution of the script. Need more investigating.
Caching domain controller SID on single system with 2 different clients overwrites identical tmp file.
tpcp AAAK000001 ZZZ000 ZZZ999 ADD
Go through the code, maybe associative arrays would simplifies things.
It's hard for end-user to find what caused an error.
The end user knows only about errors.
Sending SIGING kills only main program, background jobs keeps running.
There is a IF statement now in the script, load it from /usr/sap/trans/bin/DOMAIN.CFG
.
When I try to import more then one transports. And some import failed, tpcp continue with import next transport requests. Is better end processing after first import error.
Looping over an array not declared with "
can split the element into multiple values. The same goes for passing array as argument.
When import of transport rq ends with RC= 4 -> It's okay.
But tpcp ends with error.
Right now, if domain controller is cached, it gets cached twice:
[23.11.2019 14:11:57] D: AED: Caching transport domain for AED.
[23.11.2019 14:11:58] D: AED: Transport domain for AED is AED.
[23.11.2019 14:11:58] D: AED: Caching transport domain for domain controller AED.
Function saptransport::load_ini_file is very slow
time saptransport::load_ini_file "${TPCP_CONFIG_FILEPATH}" 1>&2
real 0m2,369s
user 0m1,051s
sys 0m1,301s
If something fails (for whatever reason), it would be great if the program would suggest a command sequence to retry what failed.
Since the output is redirected to a file, user doesn't know, what happened. The program just exists without any explanation.
The output gets overwritten because the cursor cannot get to negative positions (it cannot scroll).
Also if 2 transports are processed in a single run, the second overwritten the first one.
Not all variables are initialized for use in for loop. Bash doesn't initialize variable used in for loop definition and it can cause some serious bugs.
local lang=""
for lang in "${langs[@]}"; do
....
done
vs
for lang in "${langs[@]}"; do
....
done
It can cause some serious misbehaviour of the program.
Support for tp SUBSET is needed.
Copying transport files to non-domain controller system make the owner as non-domain controller.
Since caching domain controllers is run in the background, failing it doesn't terminate the program.
To track what has happened, generate a csv file.
Since the invocation of the script is not done with 2> debug.log, error messages show on the screen.
If a thread that is copying files dies and doesn't change its status, all threads that are waiting for it to finish will never break from the waiting loop.
Since bash-4.4 is required, it support sleep with fractions. Use it to make the program more responsive.
In reality domain controllers are cached, not transport domain.
Add formatting to tpcp::utils::usage()
using fidian/ansi.
It is really annoying to separate parameters with "
or '
. Since the format of transport, system and actions are very distinc, parse it according to format.
Copying transport to multiple systems in the same transport domain leads to errors and to files being overwritten.
A lot of what is written is not true anymore.
If I want to copy transport files to multiple systems (and some are in the same transport domain), don't copy the files. They would be overwritten and it could corrupt them.
For example, I want to do everything with a single command:
AA*
systemsBB*
systems# AA0, AA1, AA2 are in the same transport domain
tpcp AA0K999999 AA1000 AA2000 BB1000 BB2000 CPY ADD IMP DEL
CPY ADD IMP DEL
AA0K999999 AA1000 - ✔ ✔ ✔
AA2000 - ✔ ✔ ✔
BB1000 ✔ ✔ ✔ ✔
BB2000 ✔ ✔ ✔ ✔
Commenting calls of logger::log() in saptransport::load_ini_file() speeds things up (from ~1000 ms to ~50 ms).
Even though -o ConnectTimeout=5
is set with ssh
, it takes ages to timeout if hostname cannot be resolved.
Every function called from within saptransport::__run_action_on_system()
cannot terminate unless it changes the status. Make them return 1
and deal with in in saptransport::__run_action_on_system()
.
I found in bash v5.0 release notes the following:
- New Features in Bash
...
m. If a non-interactive shell with job control enabled detects that a foreground
job died due to SIGINT, it acts as if it received the SIGINT.
It might mean that my recent fix for killing background jobs work only in bash v5.0, which I tested it on.
$ TPCP_LOGGER_LEVEL=D ./tpcp AADK000001
[25.11.2019 15:28:08] I: Creating log directory './tpcp-logs/debug'.
Loading system informations from /Users/malekjir/.config/tpcp/system-definition.ini.
Caching information about transport domains.
./libs/saptransport: line 24: !2: unbound variable
./libs/saptransport: line 366: /tmp/tpcp.20191125-152808.9489.26601/saptransport_status.*: No such file or directory
Logs are located at ./tpcp-logs/debug.
Build releases using TravisCI.
sg_name
and sg_role
are not being used, no reason for keeping them.
Filesystem /dev/shm is a ram disk (much better IOps).
Currently the main.log
doesn't contain information about progress of transports with default logger level. I want to see at glance, what transports and to what systems were those processed and their final status.
To be able to add all transports in an order, I have to first run DEL action, then ADD action. If some transport is not in an import queue, it then ends with an error. Running DEL on transport not in an import queue should be "soft" error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.