Discussion:
[S3tools-general] question s3cmd to support openstack (SWIFT)
Kirubakaran Kaliannan
2016-01-25 12:46:34 UTC
Permalink
Hi ,



Openstack object store (SWIFT) has the swift3 middleware to provide S3
compatible API’s.



But, S3cmd is failing to work on the openstack as the URI (format_uri()) is
not formed correctly.



Do we have plan to support open-stack ? Following are the code change, we
have made to get this working. (similar fix is done on another github
branch forked out of this)



Please let me know if this support is in the roadmap of s3cmd development ?





*diff --git a/s3cmd/s3cmd/S3/Config.py b/s3cmd/s3cmd/S3/Config.py*

*index 82aa809..13bd44d 100644*

*--- a/s3cmd/s3cmd/S3/Config.py*

*+++ b/s3cmd/s3cmd/S3/Config.py*

*@@ -46,6 +46,9 @@ class Config(object):*

* acl_public = None*

* acl_grants = []*

* acl_revokes = []*

*+ swift_compatible = False*

* proxy_host = ""*

* proxy_port = 3128*

* encrypt = False*

*diff --git a/s3cmd/s3cmd/S3/S3.py b/s3cmd/s3cmd/S3/S3.py*

*index cd4a404..ead1c4e 100644*

*--- a/s3cmd/s3cmd/S3/S3.py*

*+++ b/s3cmd/s3cmd/S3/S3.py*

*@@ -209,8 +209,14 @@ class S3(object):*

* def format_uri(self, resource):*

* if resource['bucket'] and not
check_bucket_name_dns_conformity(resource['bucket']):*

* uri = "/%s%s" % (resource['bucket'], resource['uri'])*

* else:*

*- uri = resource['uri']*

*+ if self.config.swift_compatible and resource['bucket']:*

*+ uri = "/%s%s" % (resource['bucket'], resource['uri'])*

*+ else:*

*+ uri = resource['uri']*

*+ debug('uri = %s/%s' %(uri, self.config.swift_compatible))*

* if self.config.proxy_host != "":*

* uri = "http://%s%s" % (self.get_hostname(resource['bucket']),
uri)*

* debug('format_uri(): ' + uri)*



Thanks

-kiru
Jeremy Wadsack
2016-01-25 15:26:56 UTC
Permalink
Isn't that just path-based URIs?

- Jeremy
On Jan 25, 2016 5:16 AM, "Kirubakaran Kaliannan" <***@zadarastorage.com>
wrote:

>
>
> Hi ,
>
>
>
> Openstack object store (SWIFT) has the swift3 middleware to provide S3
> compatible API’s.
>
>
>
> But, S3cmd is failing to work on the openstack as the URI (format_uri())
> is not formed correctly.
>
>
>
> Do we have plan to support open-stack ? Following are the code change, we
> have made to get this working. (similar fix is done on another github
> branch forked out of this)
>
>
>
> Please let me know if this support is in the roadmap of s3cmd development
> ?
>
>
>
>
>
> *diff --git a/s3cmd/s3cmd/S3/Config.py b/s3cmd/s3cmd/S3/Config.py*
>
> *index 82aa809..13bd44d 100644*
>
> *--- a/s3cmd/s3cmd/S3/Config.py*
>
> *+++ b/s3cmd/s3cmd/S3/Config.py*
>
> *@@ -46,6 +46,9 @@ class Config(object):*
>
> * acl_public = None*
>
> * acl_grants = []*
>
> * acl_revokes = []*
>
> *+ swift_compatible = False*
>
> * proxy_host = ""*
>
> * proxy_port = 3128*
>
> * encrypt = False*
>
> *diff --git a/s3cmd/s3cmd/S3/S3.py b/s3cmd/s3cmd/S3/S3.py*
>
> *index cd4a404..ead1c4e 100644*
>
> *--- a/s3cmd/s3cmd/S3/S3.py*
>
> *+++ b/s3cmd/s3cmd/S3/S3.py*
>
> *@@ -209,8 +209,14 @@ class S3(object):*
>
> * def format_uri(self, resource):*
>
> * if resource['bucket'] and not
> check_bucket_name_dns_conformity(resource['bucket']):*
>
> * uri = "/%s%s" % (resource['bucket'], resource['uri'])*
>
> * else:*
>
> *- uri = resource['uri']*
>
> *+ if self.config.swift_compatible and resource['bucket']:*
>
> *+ uri = "/%s%s" % (resource['bucket'], resource['uri'])*
>
> *+ else:*
>
> *+ uri = resource['uri']*
>
> *+ debug('uri = %s/%s' %(uri, self.config.swift_compatible))*
>
> * if self.config.proxy_host != "":*
>
> * uri = "http://%s%s" %
> (self.get_hostname(resource['bucket']), uri)*
>
> * debug('format_uri(): ' + uri)*
>
>
>
> Thanks
>
> -kiru
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
> http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
> _______________________________________________
> S3tools-general mailing list
> S3tools-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/s3tools-general
>
>
Florent Viard
2016-01-25 15:56:27 UTC
Permalink
Hi Kirubakaran,

There is no need for your patch, you just need to edit your s3cfg config
file and modify the following 2 keys:
host_base
host_bucket
In both of them, your will have to remove the "%(bucket)" tag, and then
s3cmd will use the "path based" format that works right with swift3.
I'm used to work with a swift3 based service and it works ok.
But take note that swift3 will still has some annoying limitations.

Regards,
--
Florent

On Mon, Jan 25, 2016 at 1:46 PM, Kirubakaran Kaliannan <
***@zadarastorage.com> wrote:

>
>
> Hi ,
>
>
>
> Openstack object store (SWIFT) has the swift3 middleware to provide S3
> compatible API’s.
>
>
>
> But, S3cmd is failing to work on the openstack as the URI (format_uri())
> is not formed correctly.
>
>
>
> Do we have plan to support open-stack ? Following are the code change, we
> have made to get this working. (similar fix is done on another github
> branch forked out of this)
>
>
>
> Please let me know if this support is in the roadmap of s3cmd development
> ?
>
>
>
>
>
> *diff --git a/s3cmd/s3cmd/S3/Config.py b/s3cmd/s3cmd/S3/Config.py*
>
> *index 82aa809..13bd44d 100644*
>
> *--- a/s3cmd/s3cmd/S3/Config.py*
>
> *+++ b/s3cmd/s3cmd/S3/Config.py*
>
> *@@ -46,6 +46,9 @@ class Config(object):*
>
> * acl_public = None*
>
> * acl_grants = []*
>
> * acl_revokes = []*
>
> *+ swift_compatible = False*
>
> * proxy_host = ""*
>
> * proxy_port = 3128*
>
> * encrypt = False*
>
> *diff --git a/s3cmd/s3cmd/S3/S3.py b/s3cmd/s3cmd/S3/S3.py*
>
> *index cd4a404..ead1c4e 100644*
>
> *--- a/s3cmd/s3cmd/S3/S3.py*
>
> *+++ b/s3cmd/s3cmd/S3/S3.py*
>
> *@@ -209,8 +209,14 @@ class S3(object):*
>
> * def format_uri(self, resource):*
>
> * if resource['bucket'] and not
> check_bucket_name_dns_conformity(resource['bucket']):*
>
> * uri = "/%s%s" % (resource['bucket'], resource['uri'])*
>
> * else:*
>
> *- uri = resource['uri']*
>
> *+ if self.config.swift_compatible and resource['bucket']:*
>
> *+ uri = "/%s%s" % (resource['bucket'], resource['uri'])*
>
> *+ else:*
>
> *+ uri = resource['uri']*
>
> *+ debug('uri = %s/%s' %(uri, self.config.swift_compatible))*
>
> * if self.config.proxy_host != "":*
>
> * uri = "http://%s%s" %
> (self.get_hostname(resource['bucket']), uri)*
>
> * debug('format_uri(): ' + uri)*
>
>
>
> Thanks
>
> -kiru
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__pubads.g.doubleclick.net_gampad_clk-3Fid-3D267308311-26iu-3D_4140&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=wMXnxK3-1bRSpDSJXDPTHUnCAkdkgbkPnVq3n3URYSs&e=
> _______________________________________________
> S3tools-general mailing list
> S3tools-***@lists.sourceforge.net
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_s3tools-2Dgeneral&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=rKVfHl2ktjsbx8EL0OTuQ_KmoGdbO77BeiMCjesiSrE&e=
>
>
Kirubakaran Kaliannan
2016-01-26 05:13:58 UTC
Permalink
Thanks Florent.



I have tried setting the host_bucket/host_base, like below (tried with
ipaddress/hostname (with port and no port)), but still have issues using
the s3cmd.

If I set “proxy_host” it fails with “use_ssl not be https”.

Am I missing any thing else. Below is my .s3cfg config file

This works well if I create directory name with (_) in it.





[default]

access_key = 97f885c5ca3549cbaa06be07805f3a52

access_token =

add_content_encoding = True

add_encoding_exts =

add_headers =

bucket_location = US

cache_file =

cloudfront_host =

default_mime_type = binary/octet-stream

delay_updates = False

delete_after = False

delete_after_fetch = False

delete_removed = False

dry_run = False

enable_multipart = True

encoding = ANSI_X3.4-1968

encrypt = False

follow_symlinks = False

force = False

get_continue = False

gpg_command = /usr/bin/gpg

gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes
--passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s

gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes
--passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s

gpg_passphrase = 123

guess_mime_type = True

*host_base = 150.50.2.120:443 <http://150.50.2.120:443>*

*host_bucket = 150.50.2.120:443 <http://150.50.2.120:443>*

human_readable_sizes = False

ignore_failed_copy = False

invalidate_default_index_on_cf = False

invalidate_default_index_root_on_cf = True

invalidate_on_cf = False

list_md5 = False

log_target_prefix =

max_delete = -1

mime_type =

multipart_chunk_size_mb = 15

preserve_attrs = True

progress_meter = True

proxy_host = 150.50.2.120

proxy_port = 0

put_continue = False

recursive = False

recv_chunk = 4096

reduced_redundancy = False

secret_key = c7f327b012ac41198b079480304d6784

send_chunk = 4096

server_side_encryption = False

simpledb_host = sdb.amazonaws.com

skip_existing = False

socket_timeout = 300

source_address =

urlencoding_mode = normal

*use_https = True*

use_mime_magic = True

verbosity = WARNING

website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/

website_error =

website_index = index.html

signature_v2 = True



Thanks

-kiru



*From:* Florent Viard [mailto:***@seagate.com]
*Sent:* Monday, January 25, 2016 9:26 PM
*To:* s3tools-general
*Subject:* Re: [S3tools-general] question s3cmd to support openstack (SWIFT)



Hi Kirubakaran,

There is no need for your patch, you just need to edit your s3cfg config
file and modify the following 2 keys:

host_base

host_bucket

In both of them, your will have to remove the "%(bucket)" tag, and then
s3cmd will use the "path based" format that works right with swift3.

I'm used to work with a swift3 based service and it works ok.

But take note that swift3 will still has some annoying limitations.



Regards,

--
Florent

On Mon, Jan 25, 2016 at 1:46 PM, Kirubakaran Kaliannan <
***@zadarastorage.com> wrote:



Hi ,



Openstack object store (SWIFT) has the swift3 middleware to provide S3
compatible API’s.



But, S3cmd is failing to work on the openstack as the URI (format_uri()) is
not formed correctly.



Do we have plan to support open-stack ? Following are the code change, we
have made to get this working. (similar fix is done on another github
branch forked out of this)



Please let me know if this support is in the roadmap of s3cmd development ?





*diff --git a/s3cmd/s3cmd/S3/Config.py b/s3cmd/s3cmd/S3/Config.py*

*index 82aa809..13bd44d 100644*

*--- a/s3cmd/s3cmd/S3/Config.py*

*+++ b/s3cmd/s3cmd/S3/Config.py*

*@@ -46,6 +46,9 @@ class Config(object):*

* acl_public = None*

* acl_grants = []*

* acl_revokes = []*

*+ swift_compatible = False*

* proxy_host = ""*

* proxy_port = 3128*

* encrypt = False*

*diff --git a/s3cmd/s3cmd/S3/S3.py b/s3cmd/s3cmd/S3/S3.py*

*index cd4a404..ead1c4e 100644*

*--- a/s3cmd/s3cmd/S3/S3.py*

*+++ b/s3cmd/s3cmd/S3/S3.py*

*@@ -209,8 +209,14 @@ class S3(object):*

* def format_uri(self, resource):*

* if resource['bucket'] and not
check_bucket_name_dns_conformity(resource['bucket']):*

* uri = "/%s%s" % (resource['bucket'], resource['uri'])*

* else:*

*- uri = resource['uri']*

*+ if self.config.swift_compatible and resource['bucket']:*

*+ uri = "/%s%s" % (resource['bucket'], resource['uri'])*

*+ else:*

*+ uri = resource['uri']*

*+ debug('uri = %s/%s' %(uri, self.config.swift_compatible))*

* if self.config.proxy_host != "":*

* uri = "http://%s%s <http://%25s%25s>" %
(self.get_hostname(resource['bucket']), uri)*

* debug('format_uri(): ' + uri)*



Thanks

-kiru


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
https://urldefense.proofpoint.com/v2/url?u=http-3A__pubads.g.doubleclick.net_gampad_clk-3Fid-3D267308311-26iu-3D_4140&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=wMXnxK3-1bRSpDSJXDPTHUnCAkdkgbkPnVq3n3URYSs&e=
_______________________________________________
S3tools-general mailing list
S3tools-***@lists.sourceforge.net
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_s3tools-2Dgeneral&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=rKVfHl2ktjsbx8EL0OTuQ_KmoGdbO77BeiMCjesiSrE&e=


------------------------------

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7357 / Virus Database: 4522/11488 - Release Date: 01/26/16
Florent Viard
2016-01-29 22:15:00 UTC
Permalink
Regarding your configuration, you should not set anything in the
"proxy_host" line and just put:
host_base = 150.50.2.120

host_bucket = 150.50.2.120


Except if you do that explicitly, I would advise you to use the following
setting:encoding = UTF-8


Also, you haven't told us which version of s3cmd you are using, but maybe
you should try with the very last one: 1.6.1


Regards,

--
Florent <http://www.seagate.com>

On Tue, Jan 26, 2016 at 6:13 AM, Kirubakaran Kaliannan <
***@zadarastorage.com> wrote:

>
>
> Thanks Florent.
>
>
>
> I have tried setting the host_bucket/host_base, like below (tried with
> ipaddress/hostname (with port and no port)), but still have issues using
> the s3cmd.
>
> If I set “proxy_host” it fails with “use_ssl not be https”.
>
> Am I missing any thing else. Below is my .s3cfg config file
>
> This works well if I create directory name with (_) in it.
>
>
>
>
>
> [default]
>
> access_key = 97f885c5ca3549cbaa06be07805f3a52
>
> access_token =
>
> add_content_encoding = True
>
> add_encoding_exts =
>
> add_headers =
>
> bucket_location = US
>
> cache_file =
>
> cloudfront_host =
>
> default_mime_type = binary/octet-stream
>
> delay_updates = False
>
> delete_after = False
>
> delete_after_fetch = False
>
> delete_removed = False
>
> dry_run = False
>
> enable_multipart = True
>
> encoding = ANSI_X3.4-1968
>
> encrypt = False
>
> follow_symlinks = False
>
> force = False
>
> get_continue = False
>
> gpg_command = /usr/bin/gpg
>
> gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes
> --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
>
> gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes
> --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
>
> gpg_passphrase = 123
>
> guess_mime_type = True
>
> *host_base = 150.50.2.120:443
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__150.50.2.120-3A443&d=CwMFaQ&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=m1VTB86XJE02zBeabIxEYmp-g9LfnIdlRzlseG6zERA&e=>*
>
> *host_bucket = 150.50.2.120:443
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__150.50.2.120-3A443&d=CwMFaQ&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=m1VTB86XJE02zBeabIxEYmp-g9LfnIdlRzlseG6zERA&e=>*
>
> human_readable_sizes = False
>
> ignore_failed_copy = False
>
> invalidate_default_index_on_cf = False
>
> invalidate_default_index_root_on_cf = True
>
> invalidate_on_cf = False
>
> list_md5 = False
>
> log_target_prefix =
>
> max_delete = -1
>
> mime_type =
>
> multipart_chunk_size_mb = 15
>
> preserve_attrs = True
>
> progress_meter = True
>
> proxy_host = 150.50.2.120
>
> proxy_port = 0
>
> put_continue = False
>
> recursive = False
>
> recv_chunk = 4096
>
> reduced_redundancy = False
>
> secret_key = c7f327b012ac41198b079480304d6784
>
> send_chunk = 4096
>
> server_side_encryption = False
>
> simpledb_host = sdb.amazonaws.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__sdb.amazonaws.com&d=CwMFaQ&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=kXs1mXV9FC0FK0CZoHK71ffUTe3fzlf2cxStExrKdPA&e=>
>
> skip_existing = False
>
> socket_timeout = 300
>
> source_address =
>
> urlencoding_mode = normal
>
> *use_https = True*
>
> use_mime_magic = True
>
> verbosity = WARNING
>
> website_endpoint = http://%(bucket)s.s3-website-%(location)
> s.amazonaws.com/
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__s.amazonaws.com_&d=CwMFaQ&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=IAc1MYHCHKyXmSEAgV4UxvJU0QW7NWIyveiTbs_-eu8&e=>
>
> website_error =
>
> website_index = index.html
>
> signature_v2 = True
>
>
>
> Thanks
>
> -kiru
>
>
>
> *From:* Florent Viard [mailto:***@seagate.com]
> *Sent:* Monday, January 25, 2016 9:26 PM
> *To:* s3tools-general
> *Subject:* Re: [S3tools-general] question s3cmd to support openstack
> (SWIFT)
>
>
>
> Hi Kirubakaran,
>
> There is no need for your patch, you just need to edit your s3cfg config
> file and modify the following 2 keys:
>
> host_base
>
> host_bucket
>
> In both of them, your will have to remove the "%(bucket)" tag, and then
> s3cmd will use the "path based" format that works right with swift3.
>
> I'm used to work with a swift3 based service and it works ok.
>
> But take note that swift3 will still has some annoying limitations.
>
>
>
> Regards,
>
> --
> Florent
>
> On Mon, Jan 25, 2016 at 1:46 PM, Kirubakaran Kaliannan <
> ***@zadarastorage.com> wrote:
>
>
>
> Hi ,
>
>
>
> Openstack object store (SWIFT) has the swift3 middleware to provide S3
> compatible API’s.
>
>
>
> But, S3cmd is failing to work on the openstack as the URI (format_uri())
> is not formed correctly.
>
>
>
> Do we have plan to support open-stack ? Following are the code change, we
> have made to get this working. (similar fix is done on another github
> branch forked out of this)
>
>
>
> Please let me know if this support is in the roadmap of s3cmd development
> ?
>
>
>
>
>
> *diff --git a/s3cmd/s3cmd/S3/Config.py b/s3cmd/s3cmd/S3/Config.py*
>
> *index 82aa809..13bd44d 100644*
>
> *--- a/s3cmd/s3cmd/S3/Config.py*
>
> *+++ b/s3cmd/s3cmd/S3/Config.py*
>
> *@@ -46,6 +46,9 @@ class Config(object):*
>
> * acl_public = None*
>
> * acl_grants = []*
>
> * acl_revokes = []*
>
> *+ swift_compatible = False*
>
> * proxy_host = ""*
>
> * proxy_port = 3128*
>
> * encrypt = False*
>
> *diff --git a/s3cmd/s3cmd/S3/S3.py b/s3cmd/s3cmd/S3/S3.py*
>
> *index cd4a404..ead1c4e 100644*
>
> *--- a/s3cmd/s3cmd/S3/S3.py*
>
> *+++ b/s3cmd/s3cmd/S3/S3.py*
>
> *@@ -209,8 +209,14 @@ class S3(object):*
>
> * def format_uri(self, resource):*
>
> * if resource['bucket'] and not
> check_bucket_name_dns_conformity(resource['bucket']):*
>
> * uri = "/%s%s" % (resource['bucket'], resource['uri'])*
>
> * else:*
>
> *- uri = resource['uri']*
>
> *+ if self.config.swift_compatible and resource['bucket']:*
>
> *+ uri = "/%s%s" % (resource['bucket'], resource['uri'])*
>
> *+ else:*
>
> *+ uri = resource['uri']*
>
> *+ debug('uri = %s/%s' %(uri, self.config.swift_compatible))*
>
> * if self.config.proxy_host != "":*
>
> * uri = "http://%s%s
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__-2525s-2525s&d=CwMFaQ&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=9oi6oR1xMip6MwFj6Qmhx8gBF0Sm2dcoZj74EpnS4zI&e=>"
> % (self.get_hostname(resource['bucket']), uri)*
>
> * debug('format_uri(): ' + uri)*
>
>
>
> Thanks
>
> -kiru
>
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__pubads.g.doubleclick.net_gampad_clk-3Fid-3D267308311-26iu-3D_4140&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=wMXnxK3-1bRSpDSJXDPTHUnCAkdkgbkPnVq3n3URYSs&e=
> _______________________________________________
> S3tools-general mailing list
> S3tools-***@lists.sourceforge.net
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_s3tools-2Dgeneral&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=rKVfHl2ktjsbx8EL0OTuQ_KmoGdbO77BeiMCjesiSrE&e=
>
>
> ------------------------------
>
> No virus found in this message.
> Checked by AVG - www.avg.com
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.avg.com&d=CwMFaQ&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=hXUkXFs3dZUkgXJ_JZpD3vEZMa5FwJLccm6xKaBY200&e=>
> Version: 2016.0.7357 / Virus Database: 4522/11488 - Release Date: 01/26/16
>
>
> ------------------------------------------------------------------------------
> Site24x7 APM Insight: Get Deep Visibility into Application Performance
> APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
> Monitor end-to-end web transactions and take corrective actions now
> Troubleshoot faster and improve end-user experience. Signup Now!
>
> https://urldefense.proofpoint.com/v2/url?u=http-3A__pubads.g.doubleclick.net_gampad_clk-3Fid-3D267308311-26iu-3D_4140&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=E3r888XcS-H7ocL5hpRBL7cLvhSZqdoeHDYo45i_qCw&e=
> _______________________________________________
> S3tools-general mailing list
> S3tools-***@lists.sourceforge.net
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_s3tools-2Dgeneral&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=wzp8VTt_Z21vRem9UOgqInUg0lg6gcXHEr2dH2kp_UA&s=6E-M_epGRRHdHICT7SCfZRnN2MKya_YRDiR2JqvFd6Y&e=
>
>
Kirubakaran Kaliannan
2016-01-29 20:56:21 UTC
Permalink
Hi Florent,



Am I missing anything, on why this is not working for me.



Can I get some help on this ? whether the below config values are correct ?
or let meknow if you need more information.



I am finding it difficult to support swift openstack using the s3cmd.



Thanks

-kiru



*From:* Kirubakaran Kaliannan [mailto:***@zadarastorage.com]
*Sent:* Tuesday, January 26, 2016 10:44 AM
*To:* 's3tools-***@lists.sourceforge.net'
*Subject:* RE: [S3tools-general] question s3cmd to support openstack (SWIFT)





Thanks Florent.



I have tried setting the host_bucket/host_base, like below (tried with
ipaddress/hostname (with port and no port)), but still have issues using
the s3cmd.

If I set “proxy_host” it fails with “use_ssl not be https”.

Am I missing any thing else. Below is my .s3cfg config file

This works well if I create directory name with (_) in it.





[default]

access_key = 97f885c5ca3549cbaa06be07805f3a52

access_token =

add_content_encoding = True

add_encoding_exts =

add_headers =

bucket_location = US

cache_file =

cloudfront_host =

default_mime_type = binary/octet-stream

delay_updates = False

delete_after = False

delete_after_fetch = False

delete_removed = False

dry_run = False

enable_multipart = True

encoding = ANSI_X3.4-1968

encrypt = False

follow_symlinks = False

force = False

get_continue = False

gpg_command = /usr/bin/gpg

gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes
--passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s

gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes
--passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s

gpg_passphrase = 123

guess_mime_type = True

*host_base = 150.50.2.120:443 <http://150.50.2.120:443>*

*host_bucket = 150.50.2.120:443 <http://150.50.2.120:443>*

human_readable_sizes = False

ignore_failed_copy = False

invalidate_default_index_on_cf = False

invalidate_default_index_root_on_cf = True

invalidate_on_cf = False

list_md5 = False

log_target_prefix =

max_delete = -1

mime_type =

multipart_chunk_size_mb = 15

preserve_attrs = True

progress_meter = True

proxy_host = 150.50.2.120

proxy_port = 0

put_continue = False

recursive = False

recv_chunk = 4096

reduced_redundancy = False

secret_key = c7f327b012ac41198b079480304d6784

send_chunk = 4096

server_side_encryption = False

simpledb_host = sdb.amazonaws.com

skip_existing = False

socket_timeout = 300

source_address =

urlencoding_mode = normal

*use_https = True*

use_mime_magic = True

verbosity = WARNING

website_endpoint = http://%(bucket)s.s3-website-%(location)s.amazonaws.com/

website_error =

website_index = index.html

signature_v2 = True



Thanks

-kiru



*From:* Florent Viard [mailto:***@seagate.com
<***@seagate.com>]
*Sent:* Monday, January 25, 2016 9:26 PM
*To:* s3tools-general
*Subject:* Re: [S3tools-general] question s3cmd to support openstack (SWIFT)



Hi Kirubakaran,

There is no need for your patch, you just need to edit your s3cfg config
file and modify the following 2 keys:

host_base

host_bucket

In both of them, your will have to remove the "%(bucket)" tag, and then
s3cmd will use the "path based" format that works right with swift3.

I'm used to work with a swift3 based service and it works ok.

But take note that swift3 will still has some annoying limitations.



Regards,

--
Florent

On Mon, Jan 25, 2016 at 1:46 PM, Kirubakaran Kaliannan <
***@zadarastorage.com> wrote:



Hi ,



Openstack object store (SWIFT) has the swift3 middleware to provide S3
compatible API’s.



But, S3cmd is failing to work on the openstack as the URI (format_uri()) is
not formed correctly.



Do we have plan to support open-stack ? Following are the code change, we
have made to get this working. (similar fix is done on another github
branch forked out of this)



Please let me know if this support is in the roadmap of s3cmd development ?





*diff --git a/s3cmd/s3cmd/S3/Config.py b/s3cmd/s3cmd/S3/Config.py*

*index 82aa809..13bd44d 100644*

*--- a/s3cmd/s3cmd/S3/Config.py*

*+++ b/s3cmd/s3cmd/S3/Config.py*

*@@ -46,6 +46,9 @@ class Config(object):*

* acl_public = None*

* acl_grants = []*

* acl_revokes = []*

*+ swift_compatible = False*

* proxy_host = ""*

* proxy_port = 3128*

* encrypt = False*

*diff --git a/s3cmd/s3cmd/S3/S3.py b/s3cmd/s3cmd/S3/S3.py*

*index cd4a404..ead1c4e 100644*

*--- a/s3cmd/s3cmd/S3/S3.py*

*+++ b/s3cmd/s3cmd/S3/S3.py*

*@@ -209,8 +209,14 @@ class S3(object):*

* def format_uri(self, resource):*

* if resource['bucket'] and not
check_bucket_name_dns_conformity(resource['bucket']):*

* uri = "/%s%s" % (resource['bucket'], resource['uri'])*

* else:*

*- uri = resource['uri']*

*+ if self.config.swift_compatible and resource['bucket']:*

*+ uri = "/%s%s" % (resource['bucket'], resource['uri'])*

*+ else:*

*+ uri = resource['uri']*

*+ debug('uri = %s/%s' %(uri, self.config.swift_compatible))*

* if self.config.proxy_host != "":*

* uri = "http://%s%s <http://%25s%25s>" %
(self.get_hostname(resource['bucket']), uri)*

* debug('format_uri(): ' + uri)*



Thanks

-kiru


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
https://urldefense.proofpoint.com/v2/url?u=http-3A__pubads.g.doubleclick.net_gampad_clk-3Fid-3D267308311-26iu-3D_4140&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=wMXnxK3-1bRSpDSJXDPTHUnCAkdkgbkPnVq3n3URYSs&e=
_______________________________________________
S3tools-general mailing list
S3tools-***@lists.sourceforge.net
https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_s3tools-2Dgeneral&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=GEhQqSrCDlzPsOu9ww_S8dL0RpfPwWzg7DpciZD7d7Y&m=_ruIdFaqeQO6oeGokQKi6VrWNRLlglQGxwoQWoMGIMo&s=rKVfHl2ktjsbx8EL0OTuQ_KmoGdbO77BeiMCjesiSrE&e=


------------------------------

No virus found in this message.
Checked by AVG - www.avg.com
Version: 2016.0.7357 / Virus Database: 4522/11488 - Release Date: 01/26/16
Loading...