EOL Error in Python - python-3.x

I am having the following error, can someone explain to me what can I do to fix it.
def increment(i):
request =("https://www.minsalud.gov.co/sites/rid/Paginas/freesearchresults.aspx?k=&k=Salud%20Mental%20Legislacion#k=%2CSalud%20Mental%20Legislacion=+ 1"+ i+")
EOL while scanning string literal

You are missing a closing " and ) at the end of your line
request =("https://www.minsalud.gov.co/sites/rid/Paginas/freesearchresults.aspx?k=&k=Salud%20Mental%20Legislacion#k=%2CSalud%20Mental%20Legislacion=+ 1"+ i+")")

Related

terraform 11 and "concat" function: parse error

TF v.0.11 (I know it is old but I need this one)
I try to configure output this way:
value = "${concat(aws_lambda_function.lambda.*.arn, [""])}"
The error message is
Error reading config for output FUNCTION_ARN: parse error at 1:46 :
expected expression but found "["
What am I doing wrong, how to fix that?
Reason: [""] don't work for v11.
Solution:
value = "${element(concat(aws_lambda_function.lambda.*.arn, list("")), 0)}"

TCP Packets Syntax Error

I am having issues with a syntax error I can't seem to solve. I am trying to reassemble a tcp packet after a checksum.
def reassemble_tcp_feilds(self):
self.raw = struct.pack('!HHLLBBH',
self.tcp_src,
self.tcp_dst,
self.tcp_seq,
self.tcp_ack_seq,
self.tcp_hdr_len,
self.tcp_flags ,
self.tcp_wdw
)+
struct.pack("H",
self.tcp_chksum
)+
struct.pack('!H',
self.tcp_urg_ptr
)
return
The error occurs in the addition of the first struct.pack with the next struct.pack. Any suggestion will be appreciated.
In python, you can't end a line with an operator, the + needs to have something after it, not just a new line. This should work for you, however:
def reassemble_tcp_feilds(self):
self.raw = struct.pack('!HHLLBBH',
self.tcp_src,
self.tcp_dst,
self.tcp_seq,
self.tcp_ack_seq,
self.tcp_hdr_len,
self.tcp_flags ,
self.tcp_wdw
)+struct.pack("H",
self.tcp_chksum
)+struct.pack('!H',
self.tcp_urg_ptr
)
return

Invalid Syntax for PEP-8

I'm receiving a notification that advised the below script is not PEP-8:
example_var = print('whoa')
Output:
[E] invalid syntax.
It's showing that the error is a result of the first parentheses in the print statement, but nothing looks off to me.
example_var = print('whoa')
example_var

Jenkins: ${BUILD_LOG, maxLines, escapeHtml} not working

I am trying to use "${BUILD_LOG, maxLines, escapeHtml}" like discribed in:
How can I take last 20 lines from the $BUILD_LOG variable?
Unfortunately it doesn't work for me.
I get this error:
Script1.groovy: 114: expecting anything but ''\n''; got it anyway # line 114, column 301.
arted by user MYUSERNAME
My code in this line is:
msg.setText("This build (" + build.getFullDisplayName()
+ " ) contains the following tasks:\n\nTASK\t\t\t IMPLEMENTER:\n"
+ taskList + "\n\n\nLink to this
build: ${BUILD_URL} \n ${BUILD_LOG, maxLines=9999, escapeHtml=false}" );
If I take this out the following, it works. Thats why my guess is, that "BUILD_LOG" is not working anymore?
${BUILD_LOG, maxLines=9999, escapeHtml=false}
EDIT:
Maybe as addition: I am trying to do this withing the PreSend groovy script.
Since I am building the Email text dynamically.
${BUILD_URL} works fine, ${BUILD_LOG, maxLines=9999, escapeHtml=false} doesn't (for me) i am looking for a solution for this...
the msg object is a java MimeMessage.
Thanks,
Daniel
That error message is usually related to not closed quotes, comments started with / instead of //, etc. In your code the only thing I can see is that your third line is not finished properly, i.e., after "\n\n\nLink to this you are not closing double quotes and instead you are starting a new line (thereby the expecting anything but ''\n''.
Try to write the whole line:
msg.setText("This build (" + build.getFullDisplayName()
+ " ) contains the following tasks:\n\nTASK\t\t\t IMPLEMENTER:\n"
+ taskList + "\n\n\nLink to this build: ${BUILD_URL} \n ${BUILD_LOG, maxLines=9999, escapeHtml=false}" );
or close the quotes instead:
msg.setText("This build (" + build.getFullDisplayName()
+ " ) contains the following tasks:\n\nTASK\t\t\t IMPLEMENTER:\n"
+ taskList + "\n\n\nLink to this "
+ "build: ${BUILD_URL} \n ${BUILD_LOG, maxLines=9999, escapeHtml=false}" );
I used the below and it's working fine for me.
${BUILD_LOG, maxLines=10, escapeHtml=false}
I tried with Jenkins version 1.617
Have you tried to set escapeHtml=true? It may happen that this token expanded as is and then string in " " becomes not valid.
In latest version variable ${BUILD_LOG} wasn't available for me - only solution to get log in email content was for me setting:
msg.setText(build.getLog())
as Default Pre-send Script in Jenkins global configuration...

how to check if a colmmande return is true or false selenium-ide

I'm trying to get a command return with selenium ide by doing it :
storeTextPresent|myText|title
gotoIf|storedVars.tite|true
echo|${"true"}
but it doesnt work...i have : [error] Unexpected Exception: fileName -> chrome://flowcontrol/content/extensions/goto-sel-ide.js?1347871647495, lineNumber -> 120.
Does anybody know how to get the return?
Thank you
I didn't check for boolean support on gotoIf, but if gotoIf wants to go to a label, I don't see a label defined in the above script.
Also, the "storedVars.tite" reference looks to be misspelled.

Resources