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
Harbor 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
cf4edc71
Commit
cf4edc71
authored
3 years ago
by
Jorge Camarero Vera
Browse files
Options
Downloads
Patches
Plain Diff
Creation of method toCamelCaseString() for cta-admin
parent
4dfd3ae1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmdline/CtaAdminTextFormatter.cpp
+2
-3
2 additions, 3 deletions
cmdline/CtaAdminTextFormatter.cpp
common/dataStructures/MountType.cpp
+20
-1
20 additions, 1 deletion
common/dataStructures/MountType.cpp
common/dataStructures/MountType.hpp
+5
-0
5 additions, 0 deletions
common/dataStructures/MountType.hpp
with
27 additions
and
4 deletions
cmdline/CtaAdminTextFormatter.cpp
+
2
−
3
View file @
cf4edc71
...
...
@@ -305,14 +305,13 @@ void TextFormatter::print(const DriveLsItem &drls_item)
//If there is a reason, we only want to display the beginning
std
::
string
reason
=
cta
::
utils
::
postEllipsis
(
drls_item
.
reason
(),
NB_CHAR_REASON
);
const
std
::
string
mountType
=
toString
(
ProtobufToMountType
(
drls_item
.
mount_type
()));
push_back
(
drls_item
.
logical_library
(),
drls_item
.
drive_name
(),
drls_item
.
host
(),
(
drls_item
.
desired_drive_state
()
==
DriveLsItem
::
UP
?
"Up"
:
"Down"
),
mountType
!=
"NO_MOUNT"
?
mount
T
ype
:
"-"
,
toCamelCaseString
(
ProtobufToMountType
(
drls_item
.
mount
_t
ype
()))
,
toString
(
ProtobufToDriveStatus
(
drls_item
.
drive_status
())),
driveStatusSince
,
drls_item
.
vid
(),
...
...
@@ -753,7 +752,7 @@ void TextFormatter::print(const ShowQueuesItem &sq_item) {
}
push_back
(
toString
(
ProtobufToMountType
(
sq_item
.
mount_type
())),
to
CamelCase
String
(
ProtobufToMountType
(
sq_item
.
mount_type
())),
sq_item
.
tapepool
(),
sq_item
.
vo
(),
sq_item
.
logical_library
(),
...
...
This diff is collapsed.
Click to expand it.
common/dataStructures/MountType.cpp
+
20
−
1
View file @
cf4edc71
...
...
@@ -41,6 +41,25 @@ std::string toString(cta::common::dataStructures::MountType type) {
}
}
std
::
string
toCamelCaseString
(
cta
::
common
::
dataStructures
::
MountType
type
)
{
switch
(
type
)
{
case
MountType
::
ArchiveForUser
:
return
"ArchiveForUser"
;
case
MountType
::
ArchiveForRepack
:
return
"ArchiveForRepack"
;
case
MountType
::
ArchiveAllTypes
:
return
"ArchiveAllTypes"
;
case
MountType
::
Retrieve
:
return
"Retrieve"
;
case
MountType
::
Label
:
return
"Label"
;
case
MountType
::
NoMount
:
return
"-"
;
default:
return
"Unknown"
;
}
}
MountType
strToMountType
(
const
std
::
string
&
mountTypeStr
)
{
if
(
mountTypeStr
==
"ARCHIVE_FOR_USER"
)
return
MountType
::
ArchiveForUser
;
else
if
(
mountTypeStr
==
"ARCHIVE_FOR_REPACK"
)
return
MountType
::
ArchiveForRepack
;
...
...
@@ -61,7 +80,7 @@ MountType getMountBasicType(MountType type) {
}
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
cta
::
common
::
dataStructures
::
MountType
&
obj
)
{
return
os
<<
toString
(
obj
);
}
...
...
This diff is collapsed.
Click to expand it.
common/dataStructures/MountType.hpp
+
5
−
0
View file @
cf4edc71
...
...
@@ -43,6 +43,11 @@ MountType getMountBasicType(MountType type);
*/
std
::
string
toString
(
MountType
type
);
/**
* Convert enum to string in camel case format to show in cta-admnin
*/
std
::
string
toCamelCaseString
(
cta
::
common
::
dataStructures
::
MountType
type
);
/**
* Convert string to enum. Needed to get values from DB.
*/
...
...
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