New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.3]register twice with uppercase chars in hostname (BZ1361309) #5311
[6.3]register twice with uppercase chars in hostname (BZ1361309) #5311
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5311 +/- ##
=======================================
Coverage 60.89% 60.89%
=======================================
Files 34 34
Lines 3659 3659
=======================================
Hits 2228 2228
Misses 1431 1431 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, it was another idea. Maybe, I read you code wrong, but you should cover not register host twice, but register host with name like 'aaaAAAaaa' and then 'AAAAAAAAA', but you register 'AAAAAAAAA' twice. That is completely another thing, so please re-implement test case to that scenario.
And it is completely understandable why it was failing in the first place. I doubt that re-registering is going fail at all
Yeah. I checked the PR to the code base. They meant specifically what I meant in my comment above |
and it should not be |
@oshtaier please point to the description that host name should be changed between registrations, |
@oshtaier the bug description
is there some think I cannot understand here ???
where is changing hostname ??? |
@oshtaier I do not agree with you. |
Okay, if you want to do in that way then why do you do |
Ok no problem with the name, I will change that to some thing like AbCdEf |
Thanks! |
b32f16d
to
9504472
Compare
@oshtaier updated the name generated for test was "KfMtWeXaHa"
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
tests/foreman/cli/test_host.py
Outdated
name_chars[i] = name_chars[i].upper() | ||
else: | ||
name_chars[i] = name_chars[i].lower() | ||
target_image = ''.join(name_chars) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One-linear suggestion instead all these lines with conditions and double conversion:
''.join((str.upper,str.lower)[i%2](ch) for i,ch in enumerate(name))
But maybe it's a bit too tricky, i'm not sure. Anyhow, not a blocker 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or at least you could drop else:
:
name_chars = list(name.lower())
for i in range(len(name_chars)):
if i % 2 == 0:
name_chars[i] = name_chars[i].upper()
target_image = ''.join(name_chars)
9504472
to
23cfcad
Compare
@abalakh @oshtaier all comments addressed generated host name was : YvWcSbBrWk
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
cover https://bugzilla.redhat.com/show_bug.cgi?id=1361309