Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dCache
cta
Commits
7b3bc2bd
Commit
7b3bc2bd
authored
2 years ago
by
Lasse Tjernaes Wardenaer
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "Use default config file if $HOME is not defined"
parent
5beb5603
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ReleaseNotes.md
+2
-0
2 additions, 0 deletions
ReleaseNotes.md
cmdline/CtaAdminCmd.cpp
+12
-11
12 additions, 11 deletions
cmdline/CtaAdminCmd.cpp
with
14 additions
and
11 deletions
ReleaseNotes.md
+
2
−
0
View file @
7b3bc2bd
...
...
@@ -4,6 +4,8 @@
-
cta/CTA#133 - Change severity from ERROR to INFO for "reported a batch of retrieve jobs" log message in Scheduler.cpp
-
cta/CTA#201 - Improve error message when oracle configured without oracle support
-
cta/CTA#203 - Refactor cta-restore-deletes-files by using the connection configuration class in standalone_cli_tools/common
### Bug fixes
-
cta/CTA#209 - handle if $HOME is not defined when choosing config file for cta-admin
# v4.7.13-1
## Summary
...
...
This diff is collapsed.
Click to expand it.
cmdline/CtaAdminCmd.cpp
+
12
−
11
View file @
7b3bc2bd
...
...
@@ -165,10 +165,10 @@ CtaAdminCmd::CtaAdminCmd(int argc, const char *const *const argv) :
m_execname
(
argv
[
0
])
{
auto
&
admincmd
=
*
(
m_request
.
mutable_admincmd
());
m_request
.
set_client_cta_version
(
CTA_VERSION
);
m_request
.
set_client_xrootd_ssi_protobuf_interface_version
(
XROOTD_SSI_PROTOBUF_INTERFACE_VERSION
);
// Strip path from execname
size_t
p
=
m_execname
.
find_last_of
(
'/'
);
...
...
@@ -197,7 +197,7 @@ CtaAdminCmd::CtaAdminCmd(int argc, const char *const *const argv) :
}
// Help is a special subcommand which suppresses errors and prints usage
if
(
argc
>
argno
&&
std
::
string
(
argv
[
argno
])
==
"help"
)
{
throwUsage
();
}
...
...
@@ -231,16 +231,17 @@ CtaAdminCmd::CtaAdminCmd(int argc, const char *const *const argv) :
}
const
std
::
string
CtaAdminCmd
::
getConfigFilePath
()
const
{
std
::
filesystem
::
path
config_file
=
DEFAULT_CLI_CONFIG
;
const
std
::
filesystem
::
path
home
=
std
::
getenv
(
"HOME"
);
const
std
::
filesystem
::
path
home_dir_config_file
=
home
/
".cta/cta-cli.conf"
;
if
(
std
::
filesystem
::
exists
(
home_dir_config_file
))
{
config_file
=
home_dir_config_file
;
}
std
::
filesystem
::
path
config_file
=
DEFAULT_CLI_CONFIG
;
if
(
m_config
)
{
if
(
std
::
getenv
(
"HOME"
))
{
const
std
::
filesystem
::
path
home
=
std
::
getenv
(
"HOME"
);
const
std
::
filesystem
::
path
home_dir_config_file
=
home
/
".cta/cta-cli.conf"
;
if
(
std
::
filesystem
::
exists
(
home_dir_config_file
))
{
config_file
=
home_dir_config_file
;
}
}
if
(
m_config
)
{
config_file
=
m_config
.
value
();
}
return
config_file
;
}
return
config_file
;
}
void
CtaAdminCmd
::
send
()
const
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment