search for: rstrip

Displaying 20 results from an estimated 45 matches for "rstrip".

Did you mean: strip
2006 Jun 04
5
Manipulating form inputs?
...g validates_xx_of but I would like to do some specific alterations. For example, I want to remove whitespaces from the ''character'' field. So I appended create() with: def create @radical = Radical.new(params[:radical]) @radical.character.lstrip! @radical.character.rstrip! if @radical.save [snip] end But alas this does not work. Either the validates_length_of in the model gets it or, when I comment that out, MySQL complains about "string too long." (my second saftey net). Where can I intercept form data before it goes to the database? Taylo...
2006 Mar 21
2
How do I get substring of utf-8 string?
I''m trying to get substring from a utf-8 encoded string. (say, first 50 characters of the string) String#[0..49] would give me the first 50 bytes not 50 characters.. I know there is jcode library, but it only let you count number of characters in utf-8 string. unicode gem doesn''t seem to help much. unicode_hacks gem seem to solve the problem, but it also seems to
2019 Nov 18
0
[PATCH v2 11/11] rhv-upload: Clean up username and password
...ot;admin@internal" - - # Read the password from file. +def read_password(): + """ + Read the password from file. + """ with builtins.open(params['output_password'], 'r') as fp: - password = fp.read() - password = password.rstrip() + data = fp.read() + return data.rstrip() - # Connect to the server. +def parse_username(): + """ + Parse out the username from the output_conn URL. + """ + parsed = urlparse(params['output_conn']) + return parsed.username or &qu...
2005 Dec 18
2
Rake Test Output Prettifier
Watching the test results scroll by, it occurred to me that there must be an easier way than either letting it go or capturing it to a log file to mess with in TextMate. Here''s my first stab at an HTMLifier for test output. Just download, unzip, chmod +x, and you can: rake | ./prake.rb Which, if you are on a Mac, should bring up a Safari window with a summary of the problems at the
2006 Jul 25
2
Compile from sources
I''ve compiled xen-3.0.2-2 from sources. I''ve went to the end without errors. The ./install.sh script have been created the /etc/grub.conf file as it : # initrd /boot/initrd-version.img #boot=/dev/hdc default=0 timeout=5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title Fedora Core (2.6.15-1.2054_FC5) root (hd0,0) kernel
2010 Oct 26
0
[PATCH node] add install.py
...or GRUB, $4 is to allow 0 as a partition number for grub + grub_part_info_cmd = "findfs LABEL=%s 2>/dev/null" % grub_dev_label + grub_part_info = subprocess.Popen(grub_part_info_cmd, shell=True, stdout=PIPE, stderr=STDOUT) + disk = grub_part_info.stdout.read() + disk = disk.rstrip(disk[-1:]) + length = len(disk) - 1 + partN = disk[length:] + partN = int(partN) - 1 + disk = disk.rstrip(disk[-1:]) + + if disk is None and partN < 0: + log("unable to determine Root partition") + sys.exit(1) + if OVIRT_VARS.has_key("OVIRT_ISCSI_ENABLE...
2023 Jan 28
1
out-format in one line
Hello, I use rsync with the option --out-format '%o %n? but want to have the contents of the mesages to be overwritten. This means that the actual message while synchronisation shall overwritte the previous one. Therefore i wanted to add a carriage return ?\r? at the end of the ?out-format string but this did not work. How can I do this? Regards Michael
2006 Mar 12
2
Find all the methods on a object in an irb session?
How can I find all the methods on an object from withing irb? Thanks, Joe
2019 Sep 16
0
[PATCH 7/8] v2v: -o rhv-upload: remove uploaded disks on failure
...in via a JSON document. +with open(sys.argv[1], 'r') as fp: + params = json.load(fp) + +# What is passed in is a password file, read the actual password. +with open(params['output_password'], 'r') as fp: + output_password = fp.read() +output_password = output_password.rstrip() + +# Parse out the username from the output_conn URL. +parsed = urlparse(params['output_conn']) +username = parsed.username or "admin@internal" + +# Connect to the server. +connection = sdk.Connection( + url = params['output_conn'], + username = username, + pass...
2013 Oct 28
0
Re: [Qemu-devel] Hvmloader: Modify ACPI to only supply _EJ0 methods for PCIslots that support hotplug by runtime patching
...ie( "Name offset 0x%x: expected 0x12 actual 0x%x" % > + (offset, aml[offset])); > + offset += 1 > + return offset + aml_pkglen_bytes(offset) + 1 > + > +lineno = 0 > +for line in fileinput.input(): > + # Strip trailing newline > + line = line.rstrip(); > + # line number and debug string to output in case of errors > + lineno = lineno + 1 > + debug = "input line %d: %s" % (lineno, line) > + #ASL listing: space, then line#, then ...., then code > + pasl = re.compile(''^\s+([0-9]+)\.\.\.\.\s*'...
2019 Sep 16
0
[PATCH 1/8] v2v: -o rhv-upload: split vmcheck out of precheck
...in via a JSON document. +with open(sys.argv[1], 'r') as fp: + params = json.load(fp) + +# What is passed in is a password file, read the actual password. +with open(params['output_password'], 'r') as fp: + output_password = fp.read() +output_password = output_password.rstrip() + +# Parse out the username from the output_conn URL. +parsed = urlparse(params['output_conn']) +username = parsed.username or "admin@internal" + +# Connect to the server. +connection = sdk.Connection( + url = params['output_conn'], + username = username, + pass...
2010 Sep 07
5
Remus blktap2 issue
...quot;/usr/lib64/python2.6/site-packages/xen/xend/server/BlktapController.py", line 212, in createDevice raise Exception, ''Failed to create device.\n stdout: %s\n stderr: %s\nCheck that target \"%s\" exists and that blktap2 driver installed in dom0.'' % (out.rstrip(), err.rstrip(), file); Exception: Failed to create device. stdout: vbd open failed: -22 stderr: Check that target "192.168.1.106:9500|aio:/home/jak/remus/XenGuest1.img" exists and that blktap2 driver installed in dom0. -------------------- Thus, it seems like the backup host doe...
2018 Mar 08
6
[PATCH v5 0/4] v2v: Add -o rhv-upload output mode.
Mainly minor fixes and code cleanups over the v4 patch. There are still several problems with this patch, but it is in a reviewable state, especially the Python code. Rich.
2018 Mar 08
0
[PATCH v5 4/4] v2v: Add -o rhv-upload output mode.
...in via a JSON document. +with open(sys.argv[1], 'r') as fp: + params = json.load(fp) + +# What is passed in is a password file, read the actual password. +with open(params['output_password'], 'r') as fp: + output_password = fp.read() +output_password = output_password.rstrip() + +# Read the OVF document. +with open(sys.argv[2], 'r') as fp: + ovf = fp.read() + +# Parse out the username from the output_conn URL. +parsed = urlparse(params['output_conn']) +username = parsed.username or "admin@internal" + +# Connect to the server. +connection =...
2018 Mar 12
1
[PATCH RHEL 7] RHEL 7: -o rhv-upload: Use Python 2 instead of Python
For interest only, here is the patch required to make -o rhv-upload work with Python 2 (for RHEL 7). I don't think we want this upstream. A couple of remarks: * It's supposed to be possible to add ‘coding: utf-8’ to the top of .py files to make Python 2 accept that the file is UTF-8 (otherwise it gives an error on loading). However I added this and it didn't appear to make any
2018 Mar 08
2
Re: [PATCH v5 4/4] v2v: Add -o rhv-upload output mode.
...open(sys.argv[1], 'r') as fp: > + params = json.load(fp) > + > +# What is passed in is a password file, read the actual password. > +with open(params['output_password'], 'r') as fp: > + output_password = fp.read() > +output_password = output_password.rstrip() > + > +# Read the OVF document. > +with open(sys.argv[2], 'r') as fp: > + ovf = fp.read() > + > +# Parse out the username from the output_conn URL. > +parsed = urlparse(params['output_conn']) > +username = parsed.username or "admin@internal" &g...
2010 Oct 22
15
Accessing Facter in other languages than Ruby?
Hi all, We''re writing a few scripts at the moment that could really make use of Facter, however the vast majority of them team (including my self!) are not proficient in Ruby, however they are highly proficient in other languages such as (dare I say it!) Python. Is there (or are there any plans to!) release bindings for other languages to enable facts to be used in scripts other
2018 Mar 11
2
Re: [PATCH v5 4/4] v2v: Add -o rhv-upload output mode.
...open(sys.argv[1], 'r') as fp: > + params = json.load(fp) > + > +# What is passed in is a password file, read the actual password. > +with open(params['output_password'], 'r') as fp: > + output_password = fp.read() > +output_password = output_password.rstrip() > + > +# Read the OVF document. > +with open(sys.argv[2], 'r') as fp: > + ovf = fp.read() > + > +# Parse out the username from the output_conn URL. > +parsed = urlparse(params['output_conn']) > +username = parsed.username or "admin@internal" &g...
2018 Mar 09
1
Re: [PATCH v5 4/4] v2v: Add -o rhv-upload output mode.
...r') as fp: > +    params = json.load(fp) > + > +# What is passed in is a password file, read the actual password. > +with open(params['output_password'], 'r') as fp: > +    output_password = fp.read() > +output_password = output_password.rstrip() > + > +# Read the OVF document. > +with open(sys.argv[2], 'r') as fp: > +    ovf = fp.read() > + > +# Parse out the username from the output_conn URL. > +parsed = urlparse(params['output_conn']) > +username = parsed.username...
2018 Mar 21
2
[PATCH v6] v2v: Add -o rhv-upload output mode.
v5 was here: https://www.redhat.com/archives/libguestfs/2018-March/msg00032.html There is only a single patch in this version because the other patches went upstream. This patch adds the virt-v2v -o rhv-upload mode (https://bugzilla.redhat.com/show_bug.cgi?id=1557273). Compared to v5, this adds the ability to make zero, trim and flush requests to the oVirt imageio server